diff options
author | David Robillard <d@drobilla.net> | 2023-03-31 17:17:41 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2023-12-02 18:49:08 -0500 |
commit | b5956c4dc6b065d664908104d5fc6752a87e3364 (patch) | |
tree | 6be1fa515891e759092bb9bea082e27c78bfb6de /tools/console.h | |
parent | 439d6ec3d6dfbea74334beace790f500e61c9b7d (diff) | |
download | serd-b5956c4dc6b065d664908104d5fc6752a87e3364.tar.gz serd-b5956c4dc6b065d664908104d5fc6752a87e3364.tar.bz2 serd-b5956c4dc6b065d664908104d5fc6752a87e3364.zip |
Add model and serd-sort utility
With all the new functionality, the complexity of the serd-pipe command-line
interface is starting to push the limits of available flags. So, instead of
grafting on further options to control a model, this commit adds a new tool,
serd-sort, which acts somewhat like a stripped-down serd-pipe that stores
statements in a model in memory.
This keeps the complexity (including the user-facing complexity) of any one
tool down, since other more focused tools can be used for streaming tasks in a
pipeline.
In other words, abandon Swissarmyknifeism, take a page from the Unix
philosophy, and try to expose the model functionality to the command-line in a
dedicated focused tool. The model implementation is tested by using this tool
to run a subset of the usual test suites, and a special suite to test statement
sorting.
Diffstat (limited to 'tools/console.h')
-rw-r--r-- | tools/console.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/console.h b/tools/console.h index d475aebc..c8c68411 100644 --- a/tools/console.h +++ b/tools/console.h @@ -6,6 +6,7 @@ #include "serd/env.h" #include "serd/input_stream.h" +#include "serd/log.h" #include "serd/memory.h" #include "serd/output_stream.h" #include "serd/reader.h" @@ -43,6 +44,7 @@ typedef struct { size_t stack_size; SerdSyntaxOptions input; SerdSyntaxOptions output; + SerdLogLevel log_level; } SerdCommonOptions; // Common "global" state of a command-line tool that writes data @@ -59,6 +61,9 @@ serd_option_iter_is_end(OptionIter iter); SerdStatus serd_option_iter_advance(OptionIter* iter); +SerdCommonOptions +serd_default_options(void); + SerdStatus serd_tool_setup(SerdTool* tool, const char* program, SerdCommonOptions options); |