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 FILEgrammar 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.
- Compare
Args - Inputs and settings shared by explicit and shorthand comparisons.
- Edit
Options - Options
editandaddshare. - FlagOp
- One operation as the flags describe it, grouped by its
-p. - Markdown
Args convert’s format and Markdown flags.- Read
Args - Options of
read. - Render
Args - How
-o FILE.pdfand-o FILE.pngare rendered (convert,diff); refused with any other output. - Retired
- A spelling 0.13 still accepts, with a note, and 0.14 removes.
- Scrub
Selection - What
jubarte scrubremoves; everything when no flag is given. - Selection
- Filters selecting individual tracked changes.
Enums§
- Command
- The subcommands; none given is the two-file compare.
- Comments
Arg --commentsofread.- Compare
Mode jubarte --mode(compare).- Debug
Check jubarte debug --check.- Debug
Command - Package-level diagnostic comparison tasks.
- Edit
Target - What
editandaddwrite: one document, or the bundle directory. - Existing
Arg --existing-revisionsofeditandadd.- Format
- A document format for
-f/--fromand-t/--to. - KindArg
--kindvalues.- Page
--page.- Patch
Format jubarte diff --format: what goes to stdout.- Revisions
jubarte convert --revisions.- Section
Break Arg jubarte append --section-break.- Task
- A task that writes a file through
-o. - Track
Arg --trackofread --for-edit.- Track
Changes --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 --datewould be told--dates). Arthur (2026-10-14):--dateis 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, asconvert --timeoutboundsconvert(#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:sourcekeeps the path). - flag_
operations - Groups the operation flags of an
editoraddinvocation by their-p, in command-line order.matchesis the subcommand’s. - json_
error {"error":{"code":…,"message":…,"usage":…}}and a newline: the line an error prints on stdout under--json.usageonly when given.- next_
command argv(the arguments after the program name) as a dry run’snext:command: without its--dry-runflag, and with--forcebefore any--whenforce. A--dry-runthat is no flag stays: a FILE after--, or an option’s value (--text --dry-run). Pure: no I/O.- next_
command_ to next_command, namingoutputas-o OUTPUTwhen 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
argvearns 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;--todecides when the extension is missing or unknown; a known extension that disagrees with--tois an error.-owith neither → the task’s usual format (convert’s depends on its input:None). No-oand 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 beword, a file that is no ZIP package.Nonewhen the bytes may be read. Every host prints this line, so a refusal reads the same on each. - refused_
package refused_inputfor 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.Nonewhen 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_errorline of a removed spelling’s error,messagebeing what followserror:(removed_error), with the usageusage_json_errorgives clap’serrorfor the sameargv. - removed_
spellings - Each
REMOVEDspellingargvuses, asretired_spellingsfinds 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_errorline of a runtime error that ends a run withexit,messagebeing what followserror:on stderr. Its code is the message’s leadingCODE:(STALE_SOURCE: …), elseUSAGEfor an exit 2 andERRORfor any other. - shell_
word argas 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 outsidecli.- slash_
path - A path as the CLI’s agent-facing outputs spell it:
/between the parts on every OS (#568). The pathsparse_jsonresolves and the view’ssource: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 --helplists the tasks;jubarte compare --helpandjubarte read --helpshow 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’ssource.pathhonest). - usage_
json_ error - The
json_errorline of a usage error clap reports forargv(no program name) run asprogram: its message withouterror:, 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.Nonefor help and version, which are not errors. - wants_
json - Whether a command line (without the program name) asks for JSON: a
--jsonflag before any--. An error then prints on stdout too, as onejson_errorline, 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);pagesis a PDF’s. - wrote_
line_ with wrote_linewith an optional; 1 change by "GiantCo"suffix (#1891).- wrote_
markup_ detail - The
; 1 change by "GiantCo"fragment of a one-shot edit/addwroteline (#1891).Nonewhen 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),patternnaming them all.