aboutsummaryrefslogtreecommitdiffstats
path: root/tools/serd-pipe.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2023-12-01 21:59:18 -0500
committerDavid Robillard <d@drobilla.net>2023-12-02 18:49:08 -0500
commit9b1139fe7045a0630e87501235af21803860b80c (patch)
tree3a7cd3ee639e0b7a6f2244177819f8843202c692 /tools/serd-pipe.c
parent94879f376f1d2b8fbb2322bf2a7dab5c3bb9e098 (diff)
downloadserd-9b1139fe7045a0630e87501235af21803860b80c.tar.gz
serd-9b1139fe7045a0630e87501235af21803860b80c.tar.bz2
serd-9b1139fe7045a0630e87501235af21803860b80c.zip
[WIP] Add support for reading and writing variables
[WIP] Command line option, move later? This adds a reader flag and serdi option for extending a syntax with support for SPARQL-like variables, for storing things like patterns or simple queries.
Diffstat (limited to 'tools/serd-pipe.c')
-rw-r--r--tools/serd-pipe.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/serd-pipe.c b/tools/serd-pipe.c
index 480afa6e..b09c12e1 100644
--- a/tools/serd-pipe.c
+++ b/tools/serd-pipe.c
@@ -51,7 +51,8 @@ print_usage(const char* const name, const bool error)
" -r ROOT_URI Keep relative URIs within ROOT_URI.\n"
" -s STRING Parse STRING as input.\n"
" -t Write terser output without newlines.\n"
- " -v Display version information and exit.\n";
+ " -v Display version information and exit.\n"
+ " -x Support parsing variable nodes like \"?x\".\n";
FILE* const os = error ? stderr : stdout;
fprintf(os, "%s", error ? "\n" : "");
@@ -161,6 +162,9 @@ main(int argc, char** argv)
writer_flags |= SERD_WRITE_TERSE;
} else if (opt == 'v') {
return serd_print_version(argv[0]);
+ } else if (opt == 'x') {
+ reader_flags |= SERD_READ_VARIABLES;
+ break;
} else if (argv[a][1] == 'B') {
if (++a == argc) {
return missing_arg(prog, 'B');