kopia lustrzana https://github.com/pabr/leansdr
Add --version
rodzic
c9f01ba87c
commit
5ad83f3bee
|
@ -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<argc )
|
||||
cfg.Fs = atof(argv[++i]);
|
||||
else if ( ! strcmp(argv[i], "--sr") && i+1<argc )
|
||||
|
|
|
@ -194,11 +194,16 @@ void usage(const char *name, FILE *f, int c, const char *info=NULL) {
|
|||
" --s16 Output 16-bit ints\n"
|
||||
" -v Output debugging info at startup and exit\n"
|
||||
" -d Output debugging info during operation\n"
|
||||
" --version Display version and exit\n"
|
||||
);
|
||||
if ( info ) fprintf(f, "** Error while processing '%s'\n", info);
|
||||
exit(c);
|
||||
}
|
||||
|
||||
#ifndef VERSION
|
||||
#define VERSION "undefined"
|
||||
#endif
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
config cfg;
|
||||
|
||||
|
@ -209,6 +214,10 @@ int main(int argc, char *argv[]) {
|
|||
cfg.verbose = true;
|
||||
else if ( ! strcmp(argv[i], "-d") )
|
||||
cfg.debug = true;
|
||||
else if ( ! strcmp(argv[i], "--version") ) {
|
||||
printf("%s\n", VERSION);
|
||||
exit(0);
|
||||
}
|
||||
else if ( ! strcmp(argv[i], "--cr") && i+1<argc ) {
|
||||
++i;
|
||||
// DVB-S
|
||||
|
|
|
@ -3,18 +3,35 @@
|
|||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
|
||||
#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<argc; ++i ) {
|
||||
if ( !strcmp(argv[i],"-c") && i+1<argc )
|
||||
if ( ! strcmp(argv[i],"-c") && i+1<argc )
|
||||
count = atoi(argv[++i]);
|
||||
else {
|
||||
fprintf(stderr, "Usage: %s [-c PACKETCOUNT]\n", argv[0]);
|
||||
fprintf(stderr, "Output numbered MPEG TS packets on stdout.\n");
|
||||
exit(1);
|
||||
else if ( ! strcmp(argv[i], "--version") ) {
|
||||
printf("%s\n", VERSION);
|
||||
exit(0);
|
||||
}
|
||||
else
|
||||
usage(argv[0], stderr, 1, argv[i]);
|
||||
}
|
||||
|
||||
for ( unsigned long t=0; count<0 || count--; ++t ) {
|
||||
|
|
Ładowanie…
Reference in New Issue