diff --git a/src/apps/leandvb.cc b/src/apps/leandvb.cc index 7093180..20d468a 100644 --- a/src/apps/leandvb.cc +++ b/src/apps/leandvb.cc @@ -1019,6 +1019,7 @@ void usage(const char *name, FILE *f, int c, const char *info=NULL) { " -h Display this help message and exit\n" " -v Output debugging info at startup and exit\n" " -d Output debugging info during operation\n" + " --version Display version and exit\n" " --fd-pp FDNUM Dump preprocessed IQ data to file descriptor\n" " --fd-info FDNUM Output demodulator status to file descriptor\n" " --fd-const FDNUM Output constellation and symbols to file descr\n" @@ -1041,6 +1042,9 @@ void usage(const char *name, FILE *f, int c, const char *info=NULL) { exit(c); } +#ifndef VERSION +#define VERSION "undefined" +#endif int main(int argc, const char *argv[]) { config cfg; @@ -1054,6 +1058,10 @@ int main(int argc, const char *argv[]) { cfg.debug2 = cfg.debug; cfg.debug = true; } + else if ( ! strcmp(argv[i], "--version") ) { + printf("%s\n", VERSION); + return 0; + } else if ( ! strcmp(argv[i], "-f") && i+1 #include +#ifndef VERSION +#define VERSION "undefined" +#endif + +void usage(const char *name, FILE *f, int c, const char *info=NULL) { + fprintf(stderr, "Usage: %s [options]\n", name); + fprintf(stderr, "Output numbered MPEG TS packets on stdout.\n"); + fprintf + (f, "\nOptions:\n" + " --version Display version and exit\n" + " -c INT Number of packets to output\n" + ); + if ( info ) fprintf(f, "Error while processing '%s'\n", info); + exit(c); +} + int main(int argc, char *argv[]) { const int SIZE = 188; int count = -1; for ( int i=1; i