Skip to main content

Command

Enum Command 

Source
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

§file: PathBuf

The document (.docx).

§json: bool

Emit one record per line on stdout (records only). The input_validity status is one JSON line on stderr; -q silences it.

§author: Vec<String>

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

§file: PathBuf

The document (.docx) whose revisions to accept.

§in_place: bool

Replace 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).

§force: bool

Overwrite the output file if it already exists.

§keep_nested_comment: bool

Keep comments and replies whose whole anchor is removed, on an empty anchor.

§selection: Selection

Revisions to accept or reject; empty selects all.

§render: RenderArgs

How 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

§file: PathBuf

The document (.docx) whose revisions to reject.

§in_place: bool

Replace 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).

§force: bool

Overwrite the output file if it already exists.

§keep_nested_comment: bool

Keep comments and replies whose whole anchor is removed, on an empty anchor.

§selection: Selection

Revisions to accept or reject; empty selects all.

§render: RenderArgs

How a .pdf or .png output is drawn.

§

Convert

Convert Word or Markdown to DOCX, PDF, PNG or Markdown.

Fields

§file: PathBuf

The 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.

§force: bool

Overwrite the output file if it already exists.

§pdf: bool

Retired: --to pdf (or -o FILE.pdf).

§png: bool

Retired: --to png (or -o FILE.png).

§report: Option<PathBuf>

Write a JSON page report ({page_count, pages:[{index,text}], fonts}).

§compress: bool

Deflate 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: MarkdownArgs

Formats and Markdown reading.

§render: RenderArgs

How a PDF or PNG output is rendered.

§fail_on_substitution: bool

Exit 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: bool

Refresh 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}.

§timeout: Option<Duration>

Give up after this many seconds: exit 124 (as timeout(1)) with nothing more written. An output being written at that moment may be left partial.

§

Diff

Review differences as GitHub, word, normal, context or side-by-side text.

Fields

§old: PathBuf

The old document: .docx or Markdown.

§new: PathBuf

The new document: .docx or Markdown.

§output: Option<PathBuf>

Write the view to FILE (.md, .markdown, .txt, .patch or .diff; stdout otherwise).

§format: PatchFormat

Choose the review view; word accepts ALL input changes first.

§columns: usize

Wrap the patch’s lines at this many columns; 0 does not wrap.

§context: usize

Unchanged lines around GitHub or context hunks; -U0 shows changes only.

§accept_changes: bool

Accept both documents’ changes before comparing. Word format always does this.

§full_lines: bool

Show complete lines instead of a 70-character window around changes.

§to: Option<Format>

Output format: md only (the patch, CriticMarkup or a text view are all text).

§from: Option<Format>

Input format of both documents [default: from each file].

§force: bool

Overwrite the output file if it already exists.

§author: String

Who made the changes: the patch’s owner.

§datetime: Option<String>

Revision timestamp (ISO 8601) [default: now, UTC]; pin it for reproducible output.

§

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

§file: PathBuf

The document (.docx) to read.

§output: Option<PathBuf>

Write the view to FILE.md, or the snapshot to FILE.json, instead of printing it.

§force: bool

Overwrite the output file if it already exists.

§args: ReadArgs

The view’s options.

§

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

§file: PathBuf

The source document (.docx). Left unchanged unless –in-place.

§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.

§plan_default: bool

--plan was given without a value (D16): the summary says so.

§consume: bool

Delete 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).

§occurrence: Vec<usize>

Pick the Nth anchor match (1-based), after –anchor in this -p group.

§content: Vec<String>

New text: replaces the anchor; rewrites the paragraph without one; on c5, the comment’s new text.

§delete: Vec<bool>

Delete the anchor, or the whole paragraph (or comment) without one.

§resolve: Vec<bool>

Resolve comment c5 (with -p c5).

§reply: Vec<String>

Reply to comment c5 (with -p c5), as add -p c5 --content.

§rewrite_others_comments: bool

Accepted 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: bool

Refuse 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: EditOptions

Author, datetime, mode and output options.

§dry_run: bool

Resolve and report only; write nothing. When every operation passes, stderr ends with the command that applies it (next:).

§skip_failed: bool

Apply 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: bool

Refuse when the edit would change nothing in the document (NO_CHANGES_REQUESTED); reports, renders and bundles do not count as a change.

§pdf: bool

Also write the PDF beside the document (the bundle: redline.pdf and clean.pdf).

§png: bool

Also write PNG pages beside the document, STEM-page-NN.png (the bundle: redline-page-NN.png and clean-page-NN.png).

§dpi: f32

PNG resolution in dots per inch (1-1200).

§revisions: Revisions

How tracked changes are painted in the redline PDF/PNG.

§revision_palette: Option<String>

Marks for –revisions custom (see convert --help).

§operations: Vec<FlagOp>

The operations the flags describe, grouped by -p (filled after parsing).

§

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

§file: PathBuf

The source document (.docx). Left unchanged unless –in-place.

§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.

§plan_default: bool

--plan was given without a value (D16): the summary says so.

§consume: bool

Delete 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).

§occurrence: Vec<usize>

Pick the Nth anchor match (1-based), after –anchor in this -p group.

§content: Vec<String>

The paragraph, comment or reply text.

§reply: Vec<String>

Reply to comment c5 (with -p c5); the same as –content there.

§keep_others: bool

Refuse 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).

§before: Vec<bool>

A new paragraph before WHERE instead of after it.

§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: EditOptions

Author, datetime, mode and output options.

§operations: Vec<FlagOp>

The operations the flags describe, grouped by -p (filled after parsing).

§

Capabilities

What this binary can do, for agents choosing an operation.

Fields

§json: bool

The manifest or focused answer as JSON instead of text.

§operation: Option<String>

Discover one edit kind, including its fields and execution conditions.

§field: Option<String>

Discover one field, optionally within –operation.

§matrix: bool

Publish operation × target × policy edit support.

§

SelfUpdate

Check or install a release from GitHub.

Fields

§check: bool

Print the installed and latest versions; install nothing.

§yes: bool

Install without asking (needed without a terminal).

§version: Option<String>

Install this release instead of the latest, older ones included.

§

Debug

Diagnose a Word package, or compare package structures.

Fields

§sub: Option<DebugCommand>

Optional package comparison task.

§files: Vec<PathBuf>

One package, or two to compare (A then B).

§list: bool

List the package’s entries (sizes); with two files, the entries that differ.

§checks: Vec<DebugCheck>

Reports to run [default: orphans, fields, bookmarks, package, structure].

§part: Option<String>

Only parts whose name contains this (e.g. document.xml).

§grep: Option<String>

Only what contains this: textbox stories; text/runs/xml/changes/tables/styledefs/numbering lines (a runs paragraph matched on its plain text, printed whole).

§limit: usize

Examples per finding kind.

§context: usize

text/xml/runs of two files: common lines shown around each change.

§full_lines: bool

text/xml/runs/changes/styledefs/numbering/render: show complete lines instead of clipping them at 200 characters.

§

VisualDiff

Compare rendered pages pixel by pixel (different pages: exit 5).

Fields

§a: PathBuf

The document before.

§b: PathBuf

The document after.

§dpi: f32

Raster resolution of both sides in dots per inch (1-1200).

§out_dir: Option<PathBuf>

Write the changed pages’ PNGs and diff.json here (created if missing).

§json: bool

Print diff.json to stdout instead of one line per changed page.

§no_overlay: bool

Skip the diff-page-NN.png overlays.

§force: bool

Overwrite files already in –out-dir.

§

Comments

List comments, threads and the text they annotate.

Fields

§file: PathBuf

The document (.docx).

§json: bool

Emit one record per line on stdout (records only). The input_validity status is one JSON line on stderr; -q silences it.

§author: Option<String>

Only this author’s comments (exact match).

§latest: bool

One comment per thread: the newest.

§

Append

Join documents in order, preserving images, styles, lists and notes.

Fields

§files: Vec<PathBuf>

The documents (.docx), in order.

§output: 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).

§section_break: SectionBreakArg

What separates each document from the one before it.

§keep_sections: bool

Keep each appended document’s final section (page size, margins, headers, footers) as a section of its own.

§carry_comments: bool

Carry 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.

§force: bool

Overwrite the output file if it already exists.

§render: RenderArgs

How 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

§file: PathBuf

The document (.docx).

§json: bool

JSON Lines: one object per finding, nothing when there is none.

§rules: Vec<String>

Rule sets or audit codes, comma-separated [default: word; with –original, or –baseline and –author, word and edits].

§strict: bool

Also 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.

§author: Option<String>

The author every change must carry (with –original or –baseline).

§force: bool

Replace an existing –repair output.

§

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

§file: PathBuf

The document (.docx) whose own digest the expectations must name.

§expect: Option<PathBuf>

Expectation contract (the only supported profile in this build).

§json: bool

One result envelope, including refusals.

§

Scrub

Remove authors, editing IDs, metadata and comments before sharing.

Fields

§file: PathBuf

The document (.docx) to scrub.

§output: 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).

§force: bool

Overwrite the output file if it already exists.

§scrub: ScrubSelection

Metadata and comment scrub selection.

§render: RenderArgs

How a .pdf or .png output is drawn.

Trait Implementations§

Source§

impl Debug for Command

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl FromArgMatches for Command

Source§

fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

fn update_from_arg_matches_mut<'b>( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

impl Serialize for Command

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Subcommand for Command

Source§

fn augment_subcommands<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate Self via FromArgMatches::from_arg_matches_mut Read more
Source§

fn augment_subcommands_for_update<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate self via FromArgMatches::update_from_arg_matches_mut Read more
Source§

fn has_subcommand(__clap_name: &str) -> bool

Test whether Self can parse a specific subcommand

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.