pub enum Command {
Show 20 variants
TypedEdit(TypedEdit),
EditTemplate(TemplateDispatch),
Compare(CompareArgs),
Changes {
file: PathBuf,
json: bool,
author: Vec<String>,
},
Accept {
file: PathBuf,
in_place: bool,
output: Option<PathBuf>,
force: bool,
keep_nested_comment: bool,
selection: Selection,
render: RenderArgs,
},
Reject {
file: PathBuf,
in_place: bool,
output: Option<PathBuf>,
force: bool,
keep_nested_comment: bool,
selection: Selection,
render: RenderArgs,
},
Convert {Show 13 fields
file: PathBuf,
output: Option<PathBuf>,
force: bool,
pdf: bool,
png: bool,
report: Option<PathBuf>,
compress: bool,
font_report: Option<PathBuf>,
markdown: MarkdownArgs,
render: RenderArgs,
fail_on_substitution: bool,
update_fields: bool,
timeout: Option<Duration>,
},
Diff {Show 13 fields
old: PathBuf,
new: PathBuf,
output: Option<PathBuf>,
format: PatchFormat,
columns: usize,
context: usize,
accept_changes: bool,
full_lines: bool,
to: Option<Format>,
from: Option<Format>,
force: bool,
author: String,
datetime: Option<String>,
},
Read {
file: PathBuf,
output: Option<PathBuf>,
force: bool,
args: ReadArgs,
},
Edit {Show 29 fields
file: PathBuf,
plan: Option<PathBuf>,
plan_default: bool,
consume: bool,
location: Vec<String>,
anchor: Vec<String>,
occurrence: Vec<usize>,
content: Vec<String>,
delete: Vec<bool>,
resolve: Vec<bool>,
reply: Vec<String>,
rewrite_others_comments: bool,
keep_others: bool,
accept: Vec<bool>,
reject: Vec<bool>,
strike: Vec<bool>,
restore: Vec<bool>,
visible: Vec<bool>,
style: Vec<String>,
options: EditOptions,
dry_run: bool,
skip_failed: bool,
require_change: bool,
pdf: bool,
png: bool,
dpi: f32,
revisions: Revisions,
revision_palette: Option<String>,
operations: Vec<FlagOp>,
},
Add {Show 15 fields
file: PathBuf,
plan: Option<PathBuf>,
plan_default: bool,
consume: bool,
location: Vec<String>,
anchor: Vec<String>,
occurrence: Vec<usize>,
content: Vec<String>,
reply: Vec<String>,
keep_others: bool,
before: Vec<bool>,
comment: Vec<bool>,
style: Vec<String>,
options: EditOptions,
operations: Vec<FlagOp>,
},
Capabilities {
json: bool,
operation: Option<String>,
field: Option<String>,
matrix: bool,
},
SelfUpdate {
check: bool,
yes: bool,
version: Option<String>,
},
Debug {
sub: Option<DebugCommand>,
files: Vec<PathBuf>,
list: bool,
checks: Vec<DebugCheck>,
part: Option<String>,
grep: Option<String>,
limit: usize,
context: usize,
full_lines: bool,
},
VisualDiff {
a: PathBuf,
b: PathBuf,
dpi: f32,
out_dir: Option<PathBuf>,
json: bool,
no_overlay: bool,
force: bool,
},
Comments {
file: PathBuf,
json: bool,
author: Option<String>,
latest: bool,
},
Append {
files: Vec<PathBuf>,
output: PathBuf,
section_break: SectionBreakArg,
keep_sections: bool,
carry_comments: bool,
force: bool,
render: RenderArgs,
},
Validate {
file: PathBuf,
json: bool,
rules: Vec<String>,
strict: bool,
repair: Option<PathBuf>,
baseline: Option<PathBuf>,
original: Option<PathBuf>,
author: Option<String>,
force: bool,
},
Check {
file: PathBuf,
expect: Option<PathBuf>,
json: bool,
},
Scrub {
file: PathBuf,
output: PathBuf,
force: bool,
scrub: ScrubSelection,
render: RenderArgs,
},
}Expand description
The subcommands; none given is the two-file compare.
Variants§
TypedEdit(TypedEdit)
Internal dispatch for the typed edit ACTION grammar.
EditTemplate(TemplateDispatch)
Generate a complete source-bound PlanV2 without applying edits.
Compare(CompareArgs)
Compare documents: print the redline as the agent view, or write it with -o.
Changes
List tracked changes with IDs for accept, reject and edit plans.
One line per logical change: the marks Word wrote for one edit are
one change with a joined id (r7+8+9+10), its text followed by
(N elements). A revision inside a comment body is comments.r9.
Fields
json: boolEmit one record per line on stdout (records only). The input_validity status is one JSON line on stderr; -q silences it.
Only listed changes by this author (exact match); repeat for several.
Accept
Accept all tracked changes, or select by ID, author or kind.
Every part counts: the body, headers, footers, notes and comment
bodies. A comment-body revision is comments.r9, the id changes
lists, and an id, author or kind selection settles it.
Fields
in_place: boolReplace FILE through the same atomic write as -o. A refused resolution leaves FILE unchanged. Not with -o.
output: Option<PathBuf>Output path; its extension picks the format: .docx (also any other), .md (the agent view), .pdf, .png (one file per page) or .json (the snapshot).
keep_nested_comment: boolKeep comments and replies whose whole anchor is removed, on an empty anchor.
render: RenderArgsHow a .pdf or .png output is drawn.
Reject
Reject all tracked changes, or select by ID, author or kind.
Every part counts: the body, headers, footers, notes and comment
bodies. A comment-body revision is comments.r9, the id changes
lists, and an id, author or kind selection settles it.
Fields
in_place: boolReplace FILE through the same atomic write as -o. A refused resolution leaves FILE unchanged. Not with -o.
output: Option<PathBuf>Output path; its extension picks the format: .docx (also any other), .md (the agent view), .pdf, .png (one file per page) or .json (the snapshot).
keep_nested_comment: boolKeep comments and replies whose whole anchor is removed, on an empty anchor.
render: RenderArgsHow a .pdf or .png output is drawn.
Convert
Convert Word or Markdown to DOCX, PDF, PNG or Markdown.
Fields
file: PathBufThe document to convert: .docx, Markdown (.md, .markdown), or a Word 97-2003 .doc (read into a .docx first).
output: Option<PathBuf>Output path; its extension picks the format: .docx, .md, .pdf,
.png (pages named <stem>-page-NN.png beside it) or .json (the
snapshot of the result). Without it: <stem>.pdf next to a
.docx, <stem>.docx next to Markdown, <stem>.json for
--to json; Markdown output goes to stdout.
compress: boolDeflate the PDF’s streams (/FlateDecode). Much smaller output;
the trade is that the page content is no longer plain text, so it
cannot be read with strings or grep.
font_report: Option<PathBuf>Write a JSON font-resolution report ([{requested, step, physical, bold, italic, synthetic, substituted}, …]) for this document
(plan Step 2f).
markdown: MarkdownArgsFormats and Markdown reading.
render: RenderArgsHow a PDF or PNG output is rendered.
fail_on_substitution: boolExit 4 when a requested font was substituted (listed on stderr and in –report). Every output is still written. Exit status: 0 ok, 1 error, 4 a requested font was substituted.
update_fields: boolRefresh the cached results of PAGEREF, REF, NUMPAGES, SEQ and TOC
fields from jubarte’s layout (TOCs rebuilt from the headings) in
the .docx written, after –track-changes. Field codes stay, so
Word can update them again; page numbers are jubarte’s layout, not
Word’s (docs/WORD_DIFFERENCES.md). Prints one line per field;
–report writes {page_count, fields}.
Diff
Review differences as GitHub, word, normal, context or side-by-side text.
Fields
output: Option<PathBuf>Write the view to FILE (.md, .markdown, .txt, .patch or .diff; stdout otherwise).
format: PatchFormatChoose the review view; word accepts ALL input changes first.
Who made the changes: the patch’s owner.
Read
Read the agent view: YAML header, <!-- pN --> id lines, changes and comments with ids
A YAML header, then Markdown with an <!-- pN --> id line before every
paragraph, tracked changes as CriticMarkup
followed by their ids ({++text++}{r12 @AC}) and comments with
theirs ({>>c5 @AC: …<<}).
Fields
Edit
Edit a document: -p WHERE with –anchor, –content, –delete, –resolve, –reply, –accept, –reject, –strike, –restore or –style (several -p per command), or a JSON plan. Writes FILE_modified.docx (–in-place replaces FILE; –out-dir: the bundle), then prints SUCCESS and a fenced before/after diff of the full agent views (refusal: exit 3).
Fields
plan: Option<PathBuf>Edit plan JSON: a list of operations of any kind (see
jubarte capabilities --json). Alone, it is applied to FILE; with
operation flags, they are recorded into it (created on first use)
and FILE is left as it is. Without a value: FILE_plan.json beside
FILE.
consume: boolDelete PLAN.json once it has been applied and the outputs are written (with –plan and no operation flags). Kept when –skip-failed left operations out.
location: Vec<String>Where: p12, header1, footer2.p1, t0.row1.cell2, c5 (a comment), c5.text (the text c5 covers) or r12 (a revision, with –accept, –reject, –strike or –restore). Each -p starts an operation; the flags after it belong to it.
anchor: Vec<String>Text inside WHERE the operation applies to (must occur once, unless –occurrence picks a match).
content: Vec<String>New text: replaces the anchor; rewrites the paragraph without one; on c5, the comment’s new text.
rewrite_others_comments: boolAccepted and ignored. Deleting, resolving or rewording another author’s comment is allowed unless –keep-others is set. Kept so older scripts still parse.
keep_others: boolRefuse to accept or reject another author’s tracked change, and to delete, resolve, reopen or reword their comment. Restore, strike, a comment and a reply stay allowed. JUBARTE_KEEP_OTHERS=1 sets the same guard. Another author is anyone other than –author (Jubarte when –author is left out).
accept: Vec<bool>Accept revision r12 (with -p r12; r1+2 for several); prints the
resolved change (accepted r1+2 in p3: "from" > "to").
reject: Vec<bool>Reject revision r12 (with -p r12; r1+2 for several); prints the
resolved change (rejected r0 in p3: "from" > "to").
strike: Vec<bool>Strike another author’s insertion r12 (with -p r12; r10+11 for a change of several marks, a replacement’s insertion only): our tracked deletion inside it, so the decision shows. –content is one comment on the struck words.
restore: Vec<bool>Restore another author’s deletion r12 (with -p r12; r10+11 for a change of several marks, a replacement’s deletion only): their deletion stays and our tracked insertion of its words follows it. –content is one comment on the restored words.
visible: Vec<bool>With –reject: strike each insertion and restore each deletion instead of removing the change without a trace.
style: Vec<String>Formatting for the anchored text: bold, italic, underline, strike, caps, highlight=yellow, font=Calibri, size=11, color=FF0000; any other value is a paragraph style (Heading2).
options: EditOptionsAuthor, datetime, mode and output options.
dry_run: boolResolve and report only; write nothing. When every operation
passes, stderr ends with the command that applies it (next:).
skip_failed: boolApply every operation that passes; leave out the ones that fail and every operation of their “group”. Exit 0 when one landed. The failed ones go to PLAN.failed.json (FILE_plan.failed.json for operation flags): a plan to fix and run on the output.
require_change: boolRefuse when the edit would change nothing in the document (NO_CHANGES_REQUESTED); reports, renders and bundles do not count as a change.
Add
Add a paragraph, a comment or a reply: -p WHERE –content TEXT (several -p per command). Writes FILE_modified.docx, as edit does (–in-place replaces FILE), and prints SUCCESS and a fenced before/after diff of the full agent views.
Fields
plan: Option<PathBuf>Edit plan JSON. With operation flags, they are recorded into it
(created on first use) and FILE is left as it is; alone, it is
applied to FILE, as edit --plan does. Without a value:
FILE_plan.json beside FILE.
consume: boolDelete PLAN.json once it has been applied and the outputs are written (with –plan and no operation flags).
location: Vec<String>Where: p12, header1, footer2.p1, t0.row1.cell2, or c5 for a reply. Each -p starts an operation; the flags after it belong to it.
anchor: Vec<String>Text inside WHERE to comment on (must occur once, unless –occurrence picks a match).
keep_others: boolRefuse to accept or reject another author’s tracked change, and to delete, resolve, reopen or reword their comment, when this command applies or records a plan. Restore, strike, a comment and a reply stay allowed. JUBARTE_KEEP_OTHERS=1 sets the same guard. Another author is anyone other than –author (Jubarte when –author is left out).
comment: Vec<bool>A comment on the whole paragraph (with –anchor the comment sits on the anchor and this flag is implied).
style: Vec<String>Formatting for the new paragraph’s text (bold, italic, underline, highlight=yellow) or its paragraph style (Heading2).
options: EditOptionsAuthor, datetime, mode and output options.
Capabilities
What this binary can do, for agents choosing an operation.
Fields
SelfUpdate
Check or install a release from GitHub.
Fields
Debug
Diagnose a Word package, or compare package structures.
Fields
sub: Option<DebugCommand>Optional package comparison task.
checks: Vec<DebugCheck>Reports to run [default: orphans, fields, bookmarks, package, structure].
VisualDiff
Compare rendered pages pixel by pixel (different pages: exit 5).
Fields
Comments
List comments, threads and the text they annotate.
Fields
json: boolEmit one record per line on stdout (records only). The input_validity status is one JSON line on stderr; -q silences it.
Only this author’s comments (exact match).
Append
Join documents in order, preserving images, styles, lists and notes.
Fields
output: PathBufOutput path; its extension picks the format: .docx (also any other), .md (the agent view), .pdf, .png (one file per page) or .json (the snapshot).
section_break: SectionBreakArgWhat separates each document from the one before it.
keep_sections: boolKeep each appended document’s final section (page size, margins, headers, footers) as a section of its own.
carry_comments: boolCarry the comments each appended document’s body and notes anchor, with their threads and resolution (those in headers and footers are still dropped). Off, comments are dropped and warned.
render: RenderArgsHow a .pdf or .png output is drawn.
Validate
Check Word validity, tracked edits, accessibility, style and structure; or repair Word validity.
A word or edits finding fails the run (exit 2), and so does any error; –strict fails on warnings too. With –baseline, only the findings the baseline lacks count. An unreadable file exits 1.
Fields
rules: Vec<String>Rule sets or audit codes, comma-separated [default: word; with –original, or –baseline and –author, word and edits].
strict: boolAlso fail (exit 2) on warnings from other rule sets; word and edits findings fail without it.
repair: Option<PathBuf>Write the repaired package here; remaining findings still fail.
A structural repair: it does not check the edits’ history. Add –original and –author for that.
baseline: Option<PathBuf>The document the edits started from: its findings print as already in the input (not yours), and only new ones fail the run. A finding is new by identity (code, part, place and message), never by count. With –author and no –original, the edits are checked against it too.
original: Option<PathBuf>Check tracked edits: every text change against ORIGINAL must be a revision by –author.
The author every change must carry (with –original or –baseline).
Check
Check a document against a source-bound expectation contract.
The only profile this build supports is --expect: an optional,
separately supplied, hash-bound expectations file whose typed
paragraph-text predicates (exact equality, containment, absence)
are evaluated on FILE’s own final projection. The other check
profiles (integrity, quality, layout, baseline tracking) are #961;
jubarte validate remains the validity audit. Passing checks and
natural-language requirements without executable checks never claim
the task complete.
Fields
Scrub
Remove authors, editing IDs, metadata and comments before sharing.
Fields
output: PathBufOutput path; its extension picks the format: .docx (also any other), .md (the agent view), .pdf, .png (one file per page) or .json (the snapshot).
scrub: ScrubSelectionMetadata and comment scrub selection.
render: RenderArgsHow a .pdf or .png output is drawn.
Trait Implementations§
Source§impl FromArgMatches for Command
impl FromArgMatches for Command
Source§fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
Source§fn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches,
) -> Result<Self, Error>
fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>
Source§fn update_from_arg_matches(
&mut self,
__clap_arg_matches: &ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Source§fn update_from_arg_matches_mut<'b>(
&mut self,
__clap_arg_matches: &mut ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches_mut<'b>( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Source§impl Subcommand for Command
impl Subcommand for Command
Source§fn augment_subcommands<'b>(__clap_app: Command) -> Command
fn augment_subcommands<'b>(__clap_app: Command) -> Command
Source§fn augment_subcommands_for_update<'b>(__clap_app: Command) -> Command
fn augment_subcommands_for_update<'b>(__clap_app: Command) -> Command
Command so it can instantiate self via
FromArgMatches::update_from_arg_matches_mut Read moreSource§fn has_subcommand(__clap_name: &str) -> bool
fn has_subcommand(__clap_name: &str) -> bool
Self can parse a specific subcommand