aboutsummaryrefslogtreecommitdiffstats
path: root/src/odr-padenc.cpp
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2020-07-21 15:43:06 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2020-07-21 15:43:06 +0200
commitbe7c6e78d334ffa9919b970aaecf2ff5f27a0354 (patch)
tree9cb20031ae02a88f56ad3be0c0e8e03f73959ad9 /src/odr-padenc.cpp
parent60df978a075e57ca2b4de611e0cb4ded3c36cd0a (diff)
downloadODR-PadEnc-be7c6e78d334ffa9919b970aaecf2ff5f27a0354.tar.gz
ODR-PadEnc-be7c6e78d334ffa9919b970aaecf2ff5f27a0354.tar.bz2
ODR-PadEnc-be7c6e78d334ffa9919b970aaecf2ff5f27a0354.zip
Add --version option
Diffstat (limited to 'src/odr-padenc.cpp')
-rw-r--r--src/odr-padenc.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/odr-padenc.cpp b/src/odr-padenc.cpp
index b919074..da47d5b 100644
--- a/src/odr-padenc.cpp
+++ b/src/odr-padenc.cpp
@@ -86,6 +86,7 @@ static void usage(const char* name) {
" slides is skipped. Use this if you know what you are doing !\n"
" It is useful only when -d is used\n"
" -v, --verbose Print more information to the console (may be used more than once)\n"
+ " --version Print version information and quit\n"
"\n"
"Parameters for uniform PAD encoder only:\n"
" -f, --frame-dur=DUR Enable the uniform PAD encoder and set the duration of one frame/AU in milliseconds.\n"
@@ -122,6 +123,18 @@ static std::string list_dls_files(std::vector<std::string> dls_files) {
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();
// get/check options