Skip to main content

Module cli

Module cli 

Source
Expand description

The command itself: argument parsing, option, meta and plugin wiring, source merging and serialization. The port of ts/src/jsonic-cli.ts and of go/cli/run.go.

Structs§

Captured
What one captured run produced. The counterpart of the lines a Go logger records and of cn.d.log in the TypeScript suite: one entry per printed call, so an entry that spans several physical lines (the help text, the grammar description, indented JSON) stays one entry.

Functions§

capture
Run the command and collect what it printed instead of writing it to a stream, so a caller can inspect the individual printed entries.
run
Run the command over argv, whose first entry is the program name, as std::env::args yields it. Standard input is read only when it is needed, and every line the command prints goes to stdout; a failure is reported on stderr. The return value is the process exit code.
run_with_plugins
run, with extra plugins available to -p / --plugin for this run alone. A same-named entry wins over the registry, which is how the suite injects fixture plugins without touching the process-wide registry.