Skip to main content

Cli

Struct Cli 

Source
pub struct Cli {
Show 25 fields pub items: Vec<String>, pub mode: Option<Mode>, pub stdin: bool, pub base: Option<PathBuf>, pub name: Option<String>, pub ext: Vec<String>, pub hidden: bool, pub follow: bool, pub no_ignore: bool, pub question: Option<String>, pub expect: Option<String>, pub fail_fast: bool, pub mutating: bool, pub dry_run: bool, pub timeout: Option<f64>, pub heartbeat: HeartbeatOpts, pub emit_each: Option<String>, pub emit: Option<String>, pub emit_stderr: Option<String>, pub show_output: bool, pub quiet: bool, pub json: bool, pub json_pretty: bool, pub explain: Option<Format>, pub command: Vec<String>,
}

Fields§

§items: Vec<String>

Items to dispatch over, in order (repeatable; one run per item). file:PATH expands to the file’s non-empty lines; text:VALUE is one literal item.

§mode: Option<Mode>

Pin how –name/–ext walker patterns are interpreted (promotion off): literal, glob, or regex.

§stdin: bool

Also read items from standard input, one per line (blank lines skipped), after any walker items.

§base: Option<PathBuf>

Walker item source: files under this root become items (paths). A file yields itself; a directory is descended.

§name: Option<String>

Walker item source: limit to files whose name matches; ‘|’-separated alternatives, each substring->glob->regex promoted and anchored. Implies –base . when –base is absent.

§ext: Vec<String>

Walker item source: restrict to these extensions (comma-separated, no dots). Combined with –name as alternatives. Implies –base . when –base is absent.

§hidden: bool

Include dot-entries while walking; default skips them.

§follow: bool

Follow symlinks while walking.

§no_ignore: bool

Walk gitignored / .ignore files too (the .git directory is always skipped); by default the walk skips what git would.

§question: Option<String>

Question this sweep answers; printed as a “== … ==” banner.

§expect: Option<String>

Expectation over the per-item SUCCESS count: all|any|none|N|=N|+N|-N (default: all).

§fail_fast: bool

Stop after the first per-item ERROR; remaining items are reported as skipped.

§mutating: bool

Permit the suite’s mutating tools (ct-edit, ct-patch) as the command.

§dry_run: bool

Print each expanded command without running anything.

§timeout: Option<f64>

Per item: kill the run and classify that item ERROR after SECS seconds (fractional allowed); its {CODE} becomes “timeout”.

§heartbeat: HeartbeatOpts§emit_each: Option<String>

Per-item template written to stdout. Tokens: {RESULT} {ITEM} {INDEX} {CODE} {CMD} {STDOUT} {STDERR}. Default (unless –quiet): “{RESULT} {ITEM}”.

§emit: Option<String>

Summary template written to stdout after the sweep. Tokens: {RESULT} {OK} {ERRORS} {SKIPPED} {TOTAL} {QUESTION} {EXPECT} {REASON}.

§emit_stderr: Option<String>

Summary template written to stderr (same tokens as –emit).

§show_output: bool

Also pass each child’s stdout/stderr through verbatim.

§quiet: bool

Suppress the question banner, the default per-item lines, and the default summary.

§json: bool

Emit a structured JSON result instead of text (overrides the emit templates).

§json_pretty: bool

Like --json, but pretty-printed (indented).

§explain: Option<Format>

Print agent usage docs (md or json) and exit.

§command: Vec<String>

Command and arguments run per item (after --); {ITEM} and {INDEX} expand in every element.

Trait Implementations§

Source§

impl Args for Cli

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 CommandFactory for Cli

Source§

fn command<'b>() -> Command

Build a Command that can instantiate Self. Read more
Source§

fn command_for_update<'b>() -> Command

Build a Command that can update self. Read more
Source§

impl Debug for Cli

Source§

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

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

impl FromArgMatches for Cli

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 Parser for Cli

Source§

fn parse() -> Self

Parse from std::env::args_os(), exit on error.
Source§

fn try_parse() -> Result<Self, Error>

Parse from std::env::args_os(), return Err on error.
Source§

fn parse_from<I, T>(itr: I) -> Self
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Parse from iterator, exit on error.
Source§

fn try_parse_from<I, T>(itr: I) -> Result<Self, Error>
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Parse from iterator, return Err on error.
Source§

fn update_from<I, T>(&mut self, itr: I)
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Update from iterator, exit on error. Read more
Source§

fn try_update_from<I, T>(&mut self, itr: I) -> Result<(), Error>
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Update from iterator, return Err on error.

Auto Trait Implementations§

§

impl Freeze for Cli

§

impl RefUnwindSafe for Cli

§

impl Send for Cli

§

impl Sync for Cli

§

impl Unpin for Cli

§

impl UnsafeUnpin for Cli

§

impl UnwindSafe for Cli

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<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> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.