aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2021-09-04 15:03:11 -0400
committerDavid Robillard <d@drobilla.net>2022-01-28 21:57:07 -0500
commit1fb84760a8230637a806e8e83410fc7fb6d446d2 (patch)
tree47ec80aef823da8d5c840cd053e4189dcabc8258 /tools
parentb3892cb6e4963e1bbeb346a8124101b7c3cf379b (diff)
downloadserd-1fb84760a8230637a806e8e83410fc7fb6d446d2.tar.gz
serd-1fb84760a8230637a806e8e83410fc7fb6d446d2.tar.bz2
serd-1fb84760a8230637a806e8e83410fc7fb6d446d2.zip
Add "contextual" output option
This is mainly for developer or power-user cases, where one wants to look at some data for investigation or debugging. In such cases, it's common for the set of prefixes to be implicitly known (because they are baked in to the application, for example), so printing them just produces a large amount of redundant noise. That said, it can also be useful programmatically, because it allows several snippets to be written independently and ultimately concatenated (with a header to define the prefixes) without redundancy.
Diffstat (limited to 'tools')
-rw-r--r--tools/console.c1
-rw-r--r--tools/serd-filter.c3
-rw-r--r--tools/serd-pipe.c2
3 files changed, 4 insertions, 2 deletions
diff --git a/tools/console.c b/tools/console.c
index 30c57575..ab36364d 100644
--- a/tools/console.c
+++ b/tools/console.c
@@ -220,6 +220,7 @@ serd_set_output_option(const SerdStringView name,
{"terse", SERD_WRITE_TERSE},
{"lax", SERD_WRITE_LAX},
{"rdf_type", SERD_WRITE_RDF_TYPE},
+ {"contextual", SERD_WRITE_CONTEXTUAL},
{NULL, SERD_WRITE_ASCII},
};
diff --git a/tools/serd-filter.c b/tools/serd-filter.c
index 147bf51d..ed22373c 100644
--- a/tools/serd-filter.c
+++ b/tools/serd-filter.c
@@ -194,7 +194,8 @@ print_usage(const char* const name, const bool error)
" -I SYNTAX Input syntax (turtle/ntriples/trig/nquads),\n"
" or option (lax/variables/relative/global/generated).\n"
" -O SYNTAX Output syntax (empty/turtle/ntriples/nquads),\n"
- " or option (ascii/expanded/verbatim/terse/lax).\n"
+ " or option "
+ "(ascii/contextual/expanded/verbatim/terse/lax).\n"
" -V Display version information and exit.\n"
" -f PATTERN_FILE Read pattern from PATTERN_FILE instead.\n"
" -h Display this help and exit.\n"
diff --git a/tools/serd-pipe.c b/tools/serd-pipe.c
index 25607d15..879a56b5 100644
--- a/tools/serd-pipe.c
+++ b/tools/serd-pipe.c
@@ -106,7 +106,7 @@ print_usage(const char* const name, const bool error)
" -I SYNTAX Input syntax (turtle/ntriples/trig/nquads),\n"
" or option (lax/variables/relative/global/generated).\n"
" -O SYNTAX Output syntax (empty/turtle/ntriples/nquads),\n"
- " or option (ascii/expanded/verbatim/terse/lax).\n"
+ " or option (ascii/contextual/expanded/verbatim/terse/lax).\n"
" -R ROOT_URI Keep relative URIs within ROOT_URI.\n"
" -V Display version information and exit.\n"
" -b BYTES I/O block size.\n"