aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2020-08-31 10:52:56 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2020-08-31 10:52:56 +0200
commit425d891ad3d04085d9e16893d6e5e580eb68982b (patch)
treec873126a44376096141922ace1f8f5c2d09d0d4a
parentcd564f0d275526f0618d8daab6fd457eaee722aa (diff)
downloaddabmod-425d891ad3d04085d9e16893d6e5e580eb68982b.tar.gz
dabmod-425d891ad3d04085d9e16893d6e5e580eb68982b.tar.bz2
dabmod-425d891ad3d04085d9e16893d6e5e580eb68982b.zip
Add --version option
-rw-r--r--src/DabMod.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/DabMod.cpp b/src/DabMod.cpp
index 63a1e98..979df87 100644
--- a/src/DabMod.cpp
+++ b/src/DabMod.cpp
@@ -647,6 +647,18 @@ int main(int argc, char* argv[])
setenv("TZ", "", 1);
tzset();
+ // 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;
+ }
+
try {
return launch_modulator(argc, argv);
}