From d6bdd34b8566266babefe80ce7c321fb86275ae7 Mon Sep 17 00:00:00 2001 From: Patrick Siegl Date: Thu, 21 Mar 2019 22:37:04 +0100 Subject: [PATCH] version should be printed, before any env is read --- software/infnoise.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/software/infnoise.c b/software/infnoise.c index 461fb41..b2f6670 100644 --- a/software/infnoise.c +++ b/software/infnoise.c @@ -177,6 +177,13 @@ int main(int argc, char **argv) { return opts.none; } + if (opts.version) { + printf("GIT VERSION - %s\n", GIT_VERSION); + printf("GIT COMMIT - %s\n", GIT_COMMIT); + printf("GIT DATE - %s\n", GIT_DATE); + return 0; + } + // read environment variables, not overriding command line options if (opts.serial == NULL) { opts.serial = getenv("INFNOISE_SERIAL"); @@ -207,13 +214,6 @@ int main(int argc, char **argv) { opts.outputMultiplier = 2u; // Don't throw away entropy when writing to /dev/random unless told to do so } - if (opts.version) { - printf("GIT VERSION - %s\n", GIT_VERSION); - printf("GIT COMMIT - %s\n", GIT_COMMIT); - printf("GIT DATE - %s\n", GIT_DATE); - return 0; - } - if (opts.listDevices) { devlist_node devlist = listUSBDevices(&context.message); if (devlist == NULL) {