pub struct CommandDoc {
pub path: Vec<String>,
pub route: String,
pub executable: bool,
pub usage: String,
pub about: String,
pub long_about: Option<String>,
pub args: Vec<ArgDoc>,
pub examples: Vec<ExampleView>,
pub aliases: Vec<String>,
pub subcommands: Vec<CommandDoc>,
}Expand description
One command of the executable’s command line, as clap declares it, with the commands
under it. The root is majordomus.
Fields§
§path: Vec<String>The full path, ["majordomus", "bench", "coverage"].
route: StringThe route of this command’s page, /docs/cli/bench/coverage/. Derived here once so
that no consumer downstream repeats the rule.
executable: boolWhether the command can be run on its own: a leaf, or a parent that does something when no subcommand follows it. A command that only groups others cannot be run and carries no example.
usage: StringThe usage line, majordomus bench coverage [OPTIONS], derived here so that no
projection assembles one of its own.
about: StringThe one-line description.
long_about: Option<String>The long description, when the command has one.
args: Vec<ArgDoc>The arguments in declaration order: positionals and options, --help and
--version excluded.
examples: Vec<ExampleView>The documented examples of this command, in declaration order. Every one of them is parsed by this crate’s own parser and run against the built executable by the example tests; nothing is shown that is not run.
aliases: Vec<String>The other names this command answers to, ["wt"], as clap declares them.
An alias is declared once, on the command, and every projection that has a use for one — the completion, the generated workflow bridge, the reference page — reads it here rather than keeping a table of its own.
subcommands: Vec<CommandDoc>The subcommands in declaration order.
Implementations§
Source§impl CommandDoc
impl CommandDoc
Sourcepub fn flatten(&self) -> Vec<&CommandDoc>
pub fn flatten(&self) -> Vec<&CommandDoc>
Every command, this one first, then the subcommands depth first.
Sourcepub fn parent_route(&self) -> Option<String>
pub fn parent_route(&self) -> Option<String>
The route of the command this one is under, or None for the root.
Trait Implementations§
Source§impl Clone for CommandDoc
impl Clone for CommandDoc
Source§fn clone(&self) -> CommandDoc
fn clone(&self) -> CommandDoc
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CommandDoc
impl Debug for CommandDoc
impl Eq for CommandDoc
Source§impl PartialEq for CommandDoc
impl PartialEq for CommandDoc
Source§fn eq(&self, other: &CommandDoc) -> bool
fn eq(&self, other: &CommandDoc) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for CommandDoc
impl Serialize for CommandDoc
impl StructuralPartialEq for CommandDoc
Auto Trait Implementations§
impl Freeze for CommandDoc
impl RefUnwindSafe for CommandDoc
impl Send for CommandDoc
impl Sync for CommandDoc
impl Unpin for CommandDoc
impl UnsafeUnpin for CommandDoc
impl UnwindSafe for CommandDoc
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.