aboutsummaryrefslogtreecommitdiffstats
path: root/src/serdi.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2023-04-04 06:35:51 -0400
committerDavid Robillard <d@drobilla.net>2023-12-02 18:49:07 -0500
commit7219a81ad6cff840eb604983b3752d4f2097532a (patch)
tree5c071ae9575f05a75f17a2d8280e9e9aed6440ac /src/serdi.c
parent1c7a8efa90003d21e19b47bbad185390cea5963c (diff)
downloadserd-7219a81ad6cff840eb604983b3752d4f2097532a.tar.gz
serd-7219a81ad6cff840eb604983b3752d4f2097532a.tar.bz2
serd-7219a81ad6cff840eb604983b3752d4f2097532a.zip
Add support for writing terse output with minimal newlines
Diffstat (limited to 'src/serdi.c')
-rw-r--r--src/serdi.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/serdi.c b/src/serdi.c
index 01e2e764..59c66cae 100644
--- a/src/serdi.c
+++ b/src/serdi.c
@@ -68,6 +68,7 @@ print_usage(const char* const name, const bool error)
" -q Suppress all output except data.\n"
" -r ROOT_URI Keep relative URIs within ROOT_URI.\n"
" -s INPUT Parse INPUT as string (terminates options).\n"
+ " -t Write terser output without newlines.\n"
" -v Display version information and exit.\n";
FILE* const os = error ? stderr : stdout;
@@ -142,6 +143,8 @@ main(int argc, char** argv)
writer_flags &= ~(SerdWriterFlags)SERD_WRITE_STRICT;
} else if (opt == 'q') {
quiet = true;
+ } else if (opt == 't') {
+ writer_flags |= SERD_WRITE_TERSE;
} else if (opt == 'v') {
return print_version();
} else if (opt == 's') {