pub struct CommandNode {Show 18 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,
pub confession: Option<Confession>,
}Expand description
One command or subcommand in the tree: git, git rebase,
git rebase --onto’s parent, and so on.
Fields§
§name: StringThe 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.
True if this command should be hidden from the tree by default.
deprecated: Option<Text>Some(reason) when this command is deprecated.
children_filled: boolTrue 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: ProvenanceWhich source(s) contributed this node’s own fields (not its
children’s — each child has its own Provenance).
heading_attested: boolTrue 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.
confession: Option<Confession>What this node’s own --help text said about being an incomplete
document, if anything (spec §6 rule 2b: the “truncation confession”
convention — curl’s --help ending “For all options use the manual
or "–help all".”). None means the tool’s text printed no such
confession at all, which is the overwhelming common case and is
never treated as evidence of anything.
Implementations§
Source§impl CommandNode
impl CommandNode
Sourcepub fn new(name: impl Into<String>, provenance: Provenance) -> CommandNode
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
impl Clone for CommandNode
Source§fn clone(&self) -> CommandNode
fn clone(&self) -> CommandNode
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more