diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2020-08-31 10:52:56 +0200 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2020-08-31 10:52:56 +0200 |
commit | 425d891ad3d04085d9e16893d6e5e580eb68982b (patch) | |
tree | c873126a44376096141922ace1f8f5c2d09d0d4a /src | |
parent | cd564f0d275526f0618d8daab6fd457eaee722aa (diff) | |
download | dabmod-425d891ad3d04085d9e16893d6e5e580eb68982b.tar.gz dabmod-425d891ad3d04085d9e16893d6e5e580eb68982b.tar.bz2 dabmod-425d891ad3d04085d9e16893d6e5e580eb68982b.zip |
Add --version option
Diffstat (limited to 'src')
-rw-r--r-- | src/DabMod.cpp | 12 |
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); } |