aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2023-04-30 18:24:40 -0400
committerDavid Robillard <d@drobilla.net>2023-04-30 18:24:40 -0400
commit99a19fbc8e2604dc0b048c17b554d0c395810569 (patch)
treed075a961f3e87f277d301c5c9c06616499973b52 /src
parent956f9fe7b051dc1c96433b2204f61e74c2366015 (diff)
downloadserd-99a19fbc8e2604dc0b048c17b554d0c395810569.tar.gz
serd-99a19fbc8e2604dc0b048c17b554d0c395810569.tar.bz2
serd-99a19fbc8e2604dc0b048c17b554d0c395810569.zip
Add long "help" and "version" options to serdi
Although serdi still "officially" has a BSD-style interface, meson uses --version to find the version of executables. So, support that, and also add --help, since users will often try that for unknown commands.
Diffstat (limited to 'src')
-rw-r--r--src/serd_config.h2
-rw-r--r--src/serdi.c8
2 files changed, 9 insertions, 1 deletions
diff --git a/src/serd_config.h b/src/serd_config.h
index 8dbfe28b..65c294c3 100644
--- a/src/serd_config.h
+++ b/src/serd_config.h
@@ -36,7 +36,7 @@
#define SERD_SRC_SERD_CONFIG_H
// Define version unconditionally so a warning will catch a mismatch
-#define SERD_VERSION "0.31.3"
+#define SERD_VERSION "0.31.5"
#if !defined(SERD_NO_DEFAULT_CONFIG)
diff --git a/src/serdi.c b/src/serdi.c
index f6a329bb..deeac384 100644
--- a/src/serdi.c
+++ b/src/serdi.c
@@ -201,6 +201,14 @@ main(int argc, char** argv)
break;
}
+ if (!strcmp(argv[a], "--help")) {
+ return print_usage(prog, false);
+ }
+
+ if (!strcmp(argv[a], "--version")) {
+ return print_version();
+ }
+
for (int o = 1; argv[a][o]; ++o) {
const char opt = argv[a][o];