Skip to main content

Module cli

Module cli 

Source
Expand description

The jubarte command’s parser and dispatch. Shared, platform-neutral command declarations and parsing. No runtime I/O.

Modules§

edit_actions
Typed edit action grammar, independent of legacy flag grouping. Typed edit grammar. The legacy edit FILE grammar remains versioned.
edit_template
Desired-text template generation grammar. Generator arguments, kept separate from apply’s document publication flags.

Structs§

Cli
Read, edit, compare and render Word documents.
CompareArgs
Inputs and settings shared by explicit and shorthand comparisons.
EditOptions
Options edit and add share.
FlagOp
One operation as the flags describe it, grouped by its -p.
MarkdownArgs
convert’s format and Markdown flags.
ReadArgs
Options of read.
RenderArgs
How -o FILE.pdf and -o FILE.png are rendered (convert, diff); refused with any other output.
Retired
A spelling 0.13 still accepts, with a note, and 0.14 removes.
ScrubSelection
What jubarte scrub removes; everything when no flag is given.
Selection
Filters selecting individual tracked changes.

Enums§

Command
The subcommands; none given is the two-file compare.
CommentsArg
--comments of read.
CompareMode
jubarte --mode (compare).
DebugCheck
jubarte debug --check.
DebugCommand
Package-level diagnostic comparison tasks.
EditTarget
What edit and add write: one document, or the bundle directory.
ExistingArg
--existing-revisions of edit and add.
Format
A document format for -f/--from and -t/--to.
KindArg
--kind values.
Page
--page.
PatchFormat
jubarte diff --format: what goes to stdout.
Revisions
jubarte convert --revisions.
SectionBreakArg
jubarte append --section-break.
Task
A task that writes a file through -o.
TrackArg
--track of read --for-edit.
TrackChanges
--track-changes, pandoc’s values.
Tracking
--tracking.

Constants§

REMOVED
Every flag that is gone: it no longer parses, and the error names what to say instead, where clap’s own tip may name a lookalike (compare --date would be told --dates). Arthur (2026-10-14): --date is gone.
RETIRED
Every retired task name and flag (D13).

Functions§

edit_arguments
Normalize edit routing identically for parsing and usage-error reporting.
env_timeout
JUBARTE_TIMEOUT, set and non-empty: a wall-clock bound, in seconds, on any task, as convert --timeout bounds convert (#2016). An invalid value is a usage error naming the variable.
first_positional
The first positional operand the tokens name for cmd, when they carry one before any grammar failure: options and their values are skipped through the command model’s own spelling, so an option’s value is never mistaken for the operand. Recognized-mode usage envelopes use it to name the file the caller supplied (proposal §11: source keeps the path).
flag_operations
Groups the operation flags of an edit or add invocation by their -p, in command-line order. matches is the subcommand’s.
json_error
{"error":{"code":…,"message":…,"usage":…}} and a newline: the line an error prints on stdout under --json. usage only when given.
next_command
argv (the arguments after the program name) as a dry run’s next: command: without its --dry-run flag, and with --force before any -- when force. A --dry-run that is no flag stays: a FILE after --, or an option’s value (--text --dry-run). Pure: no I/O.
next_command_to
next_command, naming output as -o OUTPUT when the dry run named no output (#1847): the default it writes, so the command run as printed cannot write elsewhere. It goes ahead of --force, before any --.
notes
The stderr lines argv earns before its run or its usage error: each retired spelling’s note, then each removed task’s.
output_format
The format a task writes. -o’s extension decides; --to decides when the extension is missing or unknown; a known extension that disagrees with --to is an error. -o with neither → the task’s usual format (convert’s depends on its input: None). No -o and no --to → None: the task prints, or convert picks by input. Pure.
parse_json
Parse arguments (excluding argv0) for native-compatible adapters.
refused_input
The error line for an input no task reads, CODE: FILE is …: an OLE (.doc, encrypted) or RTF file, or, when it must be word, a file that is no ZIP package. None when the bytes may be read. Every host prints this line, so a refusal reads the same on each.
refused_package
refused_input for a package a task reads whole (validate --original): the bytes must also pass admission (crate::admission::admit), so a ZIP that holds no Word document is refused before anything is written. None when the package is admitted.
removed_error
The error a removed spelling ends the run with, naming what to say instead.
removed_json_error
The json_error line of a removed spelling’s error, message being what follows error: (removed_error), with the usage usage_json_error gives clap’s error for the same argv.
removed_spellings
Each REMOVED spelling argv uses, as retired_spellings finds them.
retired_note
The stderr line a retired spelling prints once.
retired_spellings
The retired spellings in argv (the arguments after the program name), each once, in the order they first appear. The task is the first token before -- that is neither an option nor an option’s value, compare when that is no task (the shorthand); a retired flag counts only on the task it is retired on. Expired ids (12, #12, t0.r1.c2) are not notes: the id parsers refuse them, naming the settled spelling. Pure: no I/O.
runtime_json_error
The json_error line of a runtime error that ends a run with exit, message being what follows error: on stderr. Its code is the message’s leading CODE: (STALE_SOURCE: …), else USAGE for an exit 2 and ERROR for any other.
shell_word
arg as a POSIX shell reads it back: bare when it holds only safe characters, else single-quoted. Library code (validate’s next steps) and the CLI both word commands with it, so it lives outside cli.
slash_path
A path as the CLI’s agent-facing outputs spell it: / between the parts on every OS (#568). The paths parse_json resolves and the view’s source: line are identifiers an agent reads back, so their spelling must not change with the OS; human status lines (wrote …) keep the native path. A \ inside a file name is replaced too: these outputs name files the CLI itself resolved or wrote, whose names hold none.
success_block
Confirmation of the published document, comparing the two agent views.
top_level_command
The derive model with the shorthands’ options hidden: jubarte --help lists the tasks; jubarte compare --help and jubarte read --help show every option.
typed_edit_protocol
Requested protocol on a recognized typed edit route, respecting values and --: the action name, whether the protocol is JSONL (else JSON), and the FILE operand the tokens named when they carried one before the grammar failure (used to keep the usage envelope’s source.path honest).
usage_json_error
The json_error line of a usage error clap reports for argv (no program name) run as program: its message without error: , on one line (a list clap names under it joined on, each tip after it), and the task’s usage (jubarte read [OPTIONS] <FILE>; clap’s own usage, which names the flags given, when no task is named), a line per form. None for help and version, which are not errors.
wants_json
Whether a command line (without the program name) asks for JSON: a --json flag before any --. An error then prints on stdout too, as one json_error line, for a reader that pipes stdout to a JSON parser (#1158); stderr and the exit code stay as they are.
wrote_in_place_line
wrote contract.docx in place (replaced sha256 4eb2e9c3…), plus the optional ; 1 change by "GiantCo" detail (#1888, #1891).
wrote_line
The line a writing task prints on stderr for the file it wrote: wrote r.pdf (pdf, 48213 bytes, 3 pages); pages is a PDF’s.
wrote_line_with
wrote_line with an optional ; 1 change by "GiantCo" suffix (#1891).
wrote_markup_detail
The ; 1 change by "GiantCo" fragment of a one-shot edit/add wrote line (#1891). None when the write added no markup. A markup write without a spelled author refuses (#1997), so the name is always the one the caller gave.
wrote_png_line
The line for PNG pages: wrote out/r-page-NN.png (png, 3 pages, 96 dpi), pattern naming them all.