From 99a19fbc8e2604dc0b048c17b554d0c395810569 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 30 Apr 2023 18:24:40 -0400 Subject: 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. --- src/serd_config.h | 2 +- src/serdi.c | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'src') 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]; -- cgit v1.2.1