From 40883fad3ef90ca16d09d36153dd255c531d7333 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Tue, 21 Jul 2020 15:51:54 +0200 Subject: Add --version option --- src/DabMux.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/DabMux.cpp b/src/DabMux.cpp index de0c362..c4fb692 100644 --- a/src/DabMux.cpp +++ b/src/DabMux.cpp @@ -159,6 +159,18 @@ void signalHandler(int signum) int main(int argc, char *argv[]) { + // Version handling is done very early to ensure nothing else but the version gets printed out + if (argc == 2 and strcmp(argv[1], "--version") == 0) { + fprintf(stdout, "%s\n", +#if defined(GITVERSION) + GITVERSION +#else + PACKAGE_VERSION +#endif + ); + return 0; + } + header_message(); struct sigaction sa; -- cgit v1.2.3