diff options
author | David Robillard <d@drobilla.net> | 2022-11-29 14:50:42 -0500 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2022-11-29 14:55:22 -0500 |
commit | d4e84d46c4bd488f83e93fa38d96be8aa4ee0775 (patch) | |
tree | b6e101ca873fd23ab7d19156caad89179d0cb3bd | |
parent | 676ce7d32d25cda0a60c8cad7a782e8f52391184 (diff) | |
download | sord-d4e84d46c4bd488f83e93fa38d96be8aa4ee0775.tar.gz sord-d4e84d46c4bd488f83e93fa38d96be8aa4ee0775.tar.bz2 sord-d4e84d46c4bd488f83e93fa38d96be8aa4ee0775.zip |
Fix command line help interface of sord_validate
-rw-r--r-- | NEWS | 3 | ||||
-rw-r--r-- | src/sord_validate.c | 9 | ||||
-rw-r--r-- | src/sordi.c | 10 |
3 files changed, 13 insertions, 9 deletions
@@ -1,10 +1,11 @@ sord (0.16.15) unstable; urgency=medium + * Fix command line help interface of sord_validate * Fix dependencies in pkg-config file * Override pkg-config dependency within meson * Port sord_validate to pcre2 - -- David Robillard <d@drobilla.net> Fri, 07 Oct 2022 17:24:52 +0000 + -- David Robillard <d@drobilla.net> Tue, 29 Nov 2022 19:50:26 +0000 sord (0.16.14) stable; urgency=medium diff --git a/src/sord_validate.c b/src/sord_validate.c index 18f7486..51a3748 100644 --- a/src/sord_validate.c +++ b/src/sord_validate.c @@ -107,10 +107,11 @@ print_usage(const char* name, bool error) FILE* const os = error ? stderr : stdout; fprintf(os, "Usage: %s [OPTION]... INPUT...\n", name); fprintf(os, "Validate RDF data\n\n"); - fprintf(os, " -h Display this help and exit\n"); + fprintf(os, " -h Display this help and exit.\n"); fprintf(os, " -l Print errors on a single line.\n"); - fprintf(os, " -v Display version information and exit\n"); + fprintf(os, " -v Display version information and exit.\n"); fprintf(os, + "\n" "Validate RDF data. This is a simple validator which checks\n" "that all used properties are actually defined. It does not do\n" "any fancy file retrieval, the files passed on the command line\n" @@ -714,7 +715,9 @@ main(int argc, char** argv) int a = 1; for (; a < argc && argv[a][0] == '-'; ++a) { - if (argv[a][1] == 'l') { + if (argv[a][1] == 'h') { + return print_usage(argv[0], false); + } else if (argv[a][1] == 'l') { one_line_errors = true; } else if (argv[a][1] == 'v') { return print_version(); diff --git a/src/sordi.c b/src/sordi.c index ce5e4bf..05d8194 100644 --- a/src/sordi.c +++ b/src/sordi.c @@ -45,11 +45,11 @@ print_usage(const char* name, bool error) fprintf(os, "Usage: %s [OPTION]... INPUT [BASE_URI]\n", name); fprintf(os, "Load and re-serialise RDF data.\n"); fprintf(os, "Use - for INPUT to read from standard input.\n\n"); - fprintf(os, " -h Display this help and exit\n"); - fprintf(os, " -i SYNTAX Input syntax (`turtle' or `ntriples')\n"); - fprintf(os, " -o SYNTAX Output syntax (`turtle' or `ntriples')\n"); - fprintf(os, " -s INPUT Parse INPUT as string (terminates options)\n"); - fprintf(os, " -v Display version information and exit\n"); + fprintf(os, " -h Display this help and exit.\n"); + fprintf(os, " -i SYNTAX Input syntax (`turtle' or `ntriples').\n"); + fprintf(os, " -o SYNTAX Output syntax (`turtle' or `ntriples').\n"); + fprintf(os, " -s INPUT Parse INPUT as string (terminates options).\n"); + fprintf(os, " -v Display version information and exit.\n"); return error ? 1 : 0; } |