Skip to main content

CommandNode

Struct CommandNode 

Source
pub struct CommandNode {
Show 17 fields pub name: String, pub aliases: Vec<String>, pub summary: Option<Text>, pub description: Option<Text>, pub usage: Vec<Text>, pub flags: Vec<Flag>, pub positionals: Vec<Positional>, pub subcommands: Vec<CommandNode>, pub examples: Vec<Example>, pub hidden: bool, pub deprecated: Option<Text>, pub children_filled: bool, pub group: Option<String>, pub unparsed: Vec<Text>, pub detected_framework: Option<String>, pub provenance: Provenance, pub heading_attested: bool,
}
Expand description

One command or subcommand in the tree: git, git rebase, git rebase --onto’s parent, and so on.

Fields§

§name: String

The command’s own name, e.g. "rebase" (not the full path).

§aliases: Vec<String>

Alternate names this command is also invoked as, e.g. ["stage"] for git add, or a cobra alias like "co" for "checkout".

§summary: Option<Text>

A one-line hint, shown in tree rows and as the detail pane’s headline.

§description: Option<Text>

Long-form prose, shown in the detail pane body.

§usage: Vec<Text>

Raw usage patterns, kept verbatim (not re-flowed).

§flags: Vec<Flag>

This node’s own flags (not including inherited ones from ancestors — those are represented by Flag::inherited on the flags that originated in an ancestor and were propagated down).

§positionals: Vec<Positional>

Positional arguments.

§subcommands: Vec<CommandNode>

Direct subcommands.

§examples: Vec<Example>

Worked examples.

§hidden: bool

True if this command should be hidden from the tree by default.

§deprecated: Option<Text>

Some(reason) when this command is deprecated.

§children_filled: bool

True when this node’s subcommands list is known-complete. False means the subtree has not been extracted yet (spec §5, lazy extraction) and the runner should request it on expand.

§group: Option<String>

Display grouping from the source, e.g. carapace’s group: "main" for git’s porcelain commands. Extension beyond the spec’s base schema, permitted by spec §4 (carapace’s group is a real display grouping).

§unparsed: Vec<Text>

The tool’s raw --help output, one sanitized Text per line, set only when no parse produced anything structurally plausible (spec §7 Tier B step 3 / batch 6 part 4: no flags, no subcommands, no usage). Non-empty means “we are showing you the author’s own text untouched because inventing structure would be worse” — when this is non-empty, flags/subcommands/usage/description are all empty by construction, provenance.confidence is 0.0, and a consumer (the TUI’s detail pane) must render this as a preformatted block, not re-wrap or markdown-treat it. One Text per line deliberately: it reuses Text’s own single-line invariant instead of introducing a second, weaker sanitizer for a raw blob.

§detected_framework: Option<String>

The framework Tier A′ identified for this node’s --help output (Framework::name(), e.g. "clap (v3/v4)"), if any — for display only (--doctor, the detail pane’s provenance footer), never for parsing decisions on the consumer side. mandible-core cannot depend on mandible-extract::framework::Framework (that would be a cyclic crate dependency), so this is carried as the already- rendered short name rather than the enum itself.

§provenance: Provenance

Which source(s) contributed this node’s own fields (not its children’s — each child has its own Provenance).

§heading_attested: bool

True when this node was recovered from a bare-word block sitting under a recognized command heading (spec §7 Tier B rule 1: a literal heading-vocabulary match, or a chain started by one, e.g. git’s group headings) — as opposed to being conjured from layout alone. This is positive evidence the node names a real command, independent of whether the source --help text bothered to describe it: openssl --help’s Standard commands: grid lists asn1parse, ca, ciphers, … with no per-entry description at all, and every one is a real subcommand.

Set only at the handful of call sites already gated on a recognized heading (help_text::sections::emit_subcommands, help_text::sections::process_word_grid); every other constructor (CommandNode::new, Tier A/E’s own node-building) leaves this false. That is what lets the coverage harness’s structure-sanity check (spec §13.1, xtask::coverage::structure_sanity) stop flagging openssl’s 151 genuinely empty-but-real nodes as suspicious while still flagging an empty node with no such evidence — [M-10]’s exact shape — regardless of whether its name happens to look plausible.

Implementations§

Source§

impl CommandNode

Source

pub fn new(name: impl Into<String>, provenance: Provenance) -> CommandNode

A minimal, empty node with the given name and provenance. Useful as a starting point for tiers and for tests.

Trait Implementations§

Source§

impl Clone for CommandNode

Source§

fn clone(&self) -> CommandNode

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CommandNode

Source§

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

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

impl<'de> Deserialize<'de> for CommandNode

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for CommandNode

Source§

fn eq(&self, other: &CommandNode) -> 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 CommandNode

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 CommandNode

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<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. 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.