diff options
author | David Robillard <d@drobilla.net> | 2023-04-30 18:24:40 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2023-04-30 18:24:40 -0400 |
commit | 99a19fbc8e2604dc0b048c17b554d0c395810569 (patch) | |
tree | d075a961f3e87f277d301c5c9c06616499973b52 /src/serdi.c | |
parent | 956f9fe7b051dc1c96433b2204f61e74c2366015 (diff) | |
download | serd-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/serdi.c')
-rw-r--r-- | src/serdi.c | 8 |
1 files changed, 8 insertions, 0 deletions
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]; |