Skip to main content

ReadArgs

Struct ReadArgs 

Source
pub struct ReadArgs {
Show 24 fields pub track_changes: Option<TrackChanges>, pub comments: CommentsArg, pub dates: bool, pub no_page_markers: bool, pub paragraphs: Vec<String>, pub head: Option<usize>, pub tail: Option<usize>, pub changed: bool, pub by: Option<String>, pub json: bool, pub tables: bool, pub for_edit: bool, pub accept_change: Vec<String>, pub reject_change: Vec<String>, pub existing_revisions: Option<ExistingArg>, pub track: Option<TrackArg>, pub find: Option<String>, pub regex: Option<String>, pub ignore_case: bool, pub context: Option<usize>, pub limit: Option<usize>, pub max_chars: Option<usize>, pub cursor: Option<String>, pub all: bool,
}
Expand description

Options of read.

Fields§

§track_changes: Option<TrackChanges>

Tracked changes inline (all, the default), or the text with every change accepted or rejected (also spelled accepted, rejected); the id lines then list what changed. –json and –tables read the accepted text, or under reject the rejected one, every paragraph keeping its id; the snapshot names an accept or a reject in track_changes.

§comments: CommentsArg

Comments inline (default) or hidden, with their ids on the id line of the paragraph that holds them; ignored by –json, –for-edit and the –tables grids.

§dates: bool

Timestamps on the notes of an author whose changes do not all share one (the header shows an author’s single timestamp); ignored by –json, –for-edit and the –tables grids.

§no_page_markers: bool

Skip the layout pass; page count from Word’s cached breaks, no <!-- page N of M --> lines; ignored by –json, –for-edit and the –tables grids.

§paragraphs: Vec<String>

Only these blocks: p5, p4-p7, t0, comma-separated (open-ended p17- / -p3 spellings still parse, transitionally; the 17 October 2026 contract retires them — spell the end, p17-p20). With –tables, select top-level tables (including their nested tables) by the same tN as the view, or by a pN inside them; a pick that reaches no table is refused. Print their grid, then a blank line and the same view as read -p SPEC. Repeat it to add blocks: -p p3 -p p8 reads as -p p3,p8.

§head: Option<usize>

Only the first N blocks (a table is one block).

§tail: Option<usize>

Only the last N blocks.

§changed: bool

Only the blocks with a tracked change or a comment.

§by: Option<String>

With –changed: only the blocks with this author’s marks (a handle such as AC, or the full name).

§json: bool

Print the snapshot as JSON instead of the view: schema_version, source_sha256, summary, paragraphs, stories, tables, controls, changes and comments. -p, –head, –tail, –changed and –by keep the body paragraphs they select, and every change and comment that starts in one of them, whoever made it; the rest of the snapshot stays whole. –track-changes accept or reject settles the text.

§tables: bool

Print each top-level body table as a grid: a table N: ROWSxCOLS header_rows=H widths=W,... line, then one line per row of tab-separated ids=text cells. Use -p t0,t2 or -p pN (a cell paragraph) to select top-level tables and all their nested tables, in document order, each once. tN is the view’s top-level index; nested entries follow their cell row, indented two spaces per level, labelled nested in t0.row2.cell0 (recursively, e.g. t0.row2.cell0.t0.row0.cell1). A pN or a range selects the tables that hold its paragraphs; one that reaches no table is refused. With -p, follow the selected grids with a blank line and the same view as read -p SPEC, including its YAML header. Without -p, print only the inventory. –track-changes reject reads the rejected text.

§for_edit: bool

The working document template/apply derive, as JSON: source hash, paired target ids, exact logical working text with before_sha256 and readiness per operation and range. The selection (-p/–select, –head, –tail, –changed, –by, –find, –regex) resolves on the original source and freezes before the decisions settle it. Given filters narrow together: a paragraph is selected only when every filter given matches it, and an empty result names the filters applied in coverage.omissions.

§accept_change: Vec<String>

–for-edit: the working view after accepting this revision (repeatable; it does not modify FILE).

§reject_change: Vec<String>

–for-edit: the working view after rejecting this revision (repeatable; it does not modify FILE).

§existing_revisions: Option<ExistingArg>

–for-edit: the remaining-revision policy of the working basis (default keep, matching new plans).

§track: Option<TrackArg>

–for-edit: readiness for tracked (on, the default) or direct (off) new edits.

§find: Option<String>

Print matching body paragraphs only, with the same Markdown and id lines as -p. Searches original final logical text, as –for-edit does; combined filters narrow. Like -p, the view cannot select paragraphs in headers, footers, footnotes, endnotes and comments. Use –for-edit for header/footer/note paragraphs. No match prints nothing and reports it on stderr.

§regex: Option<String>

Search with a regular expression instead of literal text (view or –for-edit). Give PATTERN here and omit –find.

§ignore_case: bool

Case-insensitive –find/–regex (view or –for-edit).

§context: Option<usize>

–for-edit: this many read-only original-source neighbours around each row.

§limit: Option<usize>

–for-edit: primary records a page returns (default 100).

§max_chars: Option<usize>

–for-edit: the text budget a page shares (default 24000); a truncated row’s preview is never complete text.

§cursor: Option<String>

–for-edit: continue an earlier bounded query (bound to its source, selection, filters and working basis).

§all: bool

–for-edit: no presentation limits (admission limits still hold).

Implementations§

Source§

impl ReadArgs

Source

pub fn paragraph_spec(&self) -> Option<String>

The -p selectors as one comma list: -p p3 -p p8 reads as -p p3,p8 (#1690). None without -p. ReadArgs::paragraphs holds one entry per -p as typed; the facade JSON carries this joined list as one string (null without -p).

Source

pub fn for_edit_request(&self) -> ForEditRequest

The read --for-edit request these flags describe (V2-10): the working basis template and apply derive — auto (and the absence of the flag) keeps the remaining revisions, on tracks new edits. read --for-edit keeps the open-ended range spellings its help documents; the bindings build the same request through this.

Trait Implementations§

Source§

impl Args for ReadArgs

Source§

fn group_id() -> Option<Id>

Report the ArgGroup::id for this set of arguments
Source§

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

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

fn augment_args_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§

impl Debug for ReadArgs

Source§

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

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

impl Default for ReadArgs

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl FromArgMatches for ReadArgs

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( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

impl PartialEq for ReadArgs

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for ReadArgs

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 StructuralPartialEq for ReadArgs

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.