From b0113afac2a68066fafbb2796963fa2cb72ac638 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Mon, 10 Mar 2014 21:33:25 +0100 Subject: Add version number to the programs --- src/AlsaDabplus.cpp | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'src/AlsaDabplus.cpp') diff --git a/src/AlsaDabplus.cpp b/src/AlsaDabplus.cpp index c08c98d..99eec6e 100644 --- a/src/AlsaDabplus.cpp +++ b/src/AlsaDabplus.cpp @@ -40,9 +40,9 @@ using namespace std; void usage(const char* name) { fprintf(stderr, - "%s is a HE-AACv2 encoder for DAB+ based on fdk-aac-dabplus\n" - "that can encode from a ALSA source, and encode\n" - "to a ZeroMQ output for ODR-DabMux.\n" + "dabplus-enc-alsa-zmq %s is a HE-AACv2 encoder for DAB+\n" + "based on fdk-aac-dabplus that can read from a ALSA source\n" + "and encode to a ZeroMQ output for ODR-DabMux.\n" "\n" "The -D option enables experimental sound card clock drift compensation.\n" "A consumer sound card has a clock that is always a bit imprecise, and\n" @@ -62,7 +62,13 @@ void usage(const char* name) { "\n" " http://opendigitalradio.org\n" "\nUsage:\n" - "%s [OPTION...]\n", name, name); + "%s [OPTION...]\n", +#if defined(GITVERSION) + GITVERSION +#else + PACKAGE_VERSION +#endif + , name); fprintf(stderr, " -b, --bitrate={ 8, 16, ..., 192 } Output bitrate in kbps. Must be 8 multiple.\n" " -D, --drift-comp Enable ALSA sound card drift compensation.\n" @@ -206,6 +212,11 @@ int main(int argc, char *argv[]) { {0,0,0,0}, }; + if (argc < 2) { + usage(argv[0]); + return 1; + } + int index; while(ch != -1) { ch = getopt_long(argc, argv, "hab:c:o:r:d:Dp:P:", longopts, &index); -- cgit v1.2.3