From 54549c6c08494781aec262987411fe3a354ffd73 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Mon, 2 Nov 2020 07:10:18 +0100 Subject: Add --version to zmq2edi and zmq2farsync --- src/zmq2edi/zmq2edi.cpp | 12 ++++++++++++ src/zmq2farsync/zmq2farsync.cpp | 12 ++++++++++++ 2 files changed, 24 insertions(+) (limited to 'src') diff --git a/src/zmq2edi/zmq2edi.cpp b/src/zmq2edi/zmq2edi.cpp index 20ddcbe..d907e6d 100644 --- a/src/zmq2edi/zmq2edi.cpp +++ b/src/zmq2edi/zmq2edi.cpp @@ -453,6 +453,18 @@ int start(int argc, char **argv) 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; + } + etiLog.level(info) << "ZMQ2EDI converter from " << PACKAGE_NAME << " " << #if defined(GITVERSION) diff --git a/src/zmq2farsync/zmq2farsync.cpp b/src/zmq2farsync/zmq2farsync.cpp index 95dc074..2c29087 100644 --- a/src/zmq2farsync/zmq2farsync.cpp +++ b/src/zmq2farsync/zmq2farsync.cpp @@ -57,6 +57,18 @@ static void usage() 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; + } + etiLog.level(info) << "ZMQ2FarSync ETI converter from " << PACKAGE_NAME << " " << #if defined(GITVERSION) -- cgit v1.2.3