diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/serd-filter.c | 7 | ||||
-rw-r--r-- | tools/serd-pipe.c | 5 | ||||
-rw-r--r-- | tools/serd-sort.c | 7 |
3 files changed, 13 insertions, 6 deletions
diff --git a/tools/serd-filter.c b/tools/serd-filter.c index 789d3149..6cf8e0e7 100644 --- a/tools/serd-filter.c +++ b/tools/serd-filter.c @@ -244,6 +244,9 @@ parse_option(OptionIter* const iter, Options* const opts) int main(int argc, char** argv) { + char default_input[] = "-"; + char* default_inputs[] = {default_input}; + Options opts = {{"", NULL, 4096u, @@ -274,8 +277,8 @@ main(int argc, char** argv) opts.inputs = argv + iter.a; opts.n_inputs = argc - iter.a; if (opts.n_inputs == 0) { - fprintf(stderr, "%s: missing input\n", argv[0]); - return print_usage(argv[0], true); + opts.n_inputs = 1; + opts.inputs = default_inputs; } // Don't add prefixes to blank node labels if there is only one input diff --git a/tools/serd-pipe.c b/tools/serd-pipe.c index 75b3e0d4..25efb54f 100644 --- a/tools/serd-pipe.c +++ b/tools/serd-pipe.c @@ -168,7 +168,8 @@ parse_option(OptionIter* const iter, Options* const opts) int main(const int argc, char* const* const argv) { - char* const default_input[] = {"-"}; + char default_input[] = "-"; + char* default_inputs[] = {default_input}; Options opts = {{"", NULL, @@ -197,7 +198,7 @@ main(const int argc, char* const* const argv) opts.n_inputs = argc - iter.a; if (opts.n_inputs + (bool)opts.input_string == 0) { opts.n_inputs = 1; - opts.inputs = default_input; + opts.inputs = default_inputs; } // Don't add prefixes to blank node labels if there is only one input diff --git a/tools/serd-sort.c b/tools/serd-sort.c index deb79cb5..8ba99445 100644 --- a/tools/serd-sort.c +++ b/tools/serd-sort.c @@ -234,6 +234,9 @@ parse_option(OptionIter* const iter, Options* const opts) int main(const int argc, char* const* const argv) { + char default_input[] = "-"; + char* default_inputs[] = {default_input}; + Options opts = {{"", NULL, 4096u, @@ -261,8 +264,8 @@ main(const int argc, char* const* const argv) opts.inputs = argv + iter.a; opts.n_inputs = argc - iter.a; if (opts.n_inputs + (bool)opts.input_string == 0) { - fprintf(stderr, "%s: missing input\n", argv[0]); - return print_usage(argv[0], true); + opts.n_inputs = 1; + opts.inputs = default_inputs; } // Don't add prefixes to blank node labels if there is only one input |