pub struct CommandMeta<'a> {Show 38 fields
pub cmd: &'a Command<'a>,
pub about: Option<&'a str>,
pub long_about: Option<&'a str>,
pub deprecated: Option<&'a str>,
pub deprecated_warn_at: Option<&'a str>,
pub deprecated_remove_at: Option<&'a str>,
pub hidden_aliases: &'a [&'a str],
pub hide: bool,
pub help_heading: Option<&'a str>,
pub surface: Option<&'a str>,
pub available_if: &'a [&'a str],
pub display_order: Option<usize>,
pub effect: Option<Effect>,
pub mount: Option<&'a str>,
pub restart_token: Option<&'a str>,
pub clause: Option<ClauseMeta<'a>>,
pub subcommand_required: bool,
pub subcommand_help_heading: Option<&'a str>,
pub subcommand_value_name: Option<&'a str>,
pub next_line_help: bool,
pub flatten_help: bool,
pub term_width: Option<usize>,
pub max_term_width: Option<usize>,
pub args_override_self: bool,
pub before_help: Option<&'a str>,
pub before_long_help: Option<&'a str>,
pub after_help: Option<&'a str>,
pub after_long_help: Option<&'a str>,
pub examples: &'a [Example<'a>],
pub headings: &'a [HeadingMeta<'a>],
pub outputs: &'a [OutputMeta<'a>],
pub select: Option<&'a str>,
pub exit_codes: &'a [ExitCodeMeta<'a>],
pub flags: &'a [FlagMeta<'a>],
pub args: &'a [ArgMeta<'a>],
pub subcommands: &'a [&'a CommandMeta<'a>],
pub groups: &'a [GroupMeta<'a>],
pub flatten_groups: &'a [FlattenGroup<'a>],
}Expand description
What a command knows about itself beyond how it parses.
Fields§
§cmd: &'a Command<'a>The parse table this describes. Names, aliases, and structure come from here rather than being repeated.
about: Option<&'a str>§long_about: Option<&'a str>§deprecated: Option<&'a str>Why this command is deprecated, plus optional release milestones.
deprecated_warn_at: Option<&'a str>§deprecated_remove_at: Option<&'a str>Aliases that work but are not shown in help or completions. Everything in
cmd.aliases and not here is visible.
hide: boolWhether the command is hidden from help and completions.
help_heading: Option<&'a str>Help section this command appears under in its parent’s command list.
surface: Option<&'a str>Named audience or compatibility surface this command belongs to.
available_if: &'a [&'a str]Descriptive availability conditions; they do not affect parsing.
display_order: Option<usize>Explicit placement within the parent’s command section.
effect: Option<Effect>What running this does to the world, for a caller deciding whether to confirm first. clap cannot express this, which is why mise keeps a 330-entry table to bolt it on afterwards.
mount: Option<&'a str>A command to run at parse time to discover further subcommands.
Only meaningful on a subcommand. The spec accepts mount inside a cmd
block and nowhere else, so setting this on the root is a mistake that
Spec::to_kdl catches in debug builds.
restart_token: Option<&'a str>A token that starts a fresh invocation of this command, such as mise’s
:::.
clause: Option<ClauseMeta<'a>>Metadata for a repeatable positional clause.
subcommand_required: boolWhether this command cannot be run on its own: naming it and stopping is an error, and one of its subcommands has to follow.
Cold metadata rather than a parse table, because it is not how a word binds —
the derive already refuses the invocation from the type, a bare T subcommand
field against an Option<T>. It is here so the emitted spec can say it, since
everything reading that spec — help, docs, completions — otherwise describes a
command as runnable when it is not.
subcommand_help_heading: Option<&'a str>Heading for the list of this command’s subcommands.
subcommand_value_name: Option<&'a str>Placeholder used for a subcommand in the usage synopsis.
next_line_help: boolPut each argument, flag, and subcommand description on the following line.
flatten_help: boolExpand each visible subcommand’s summary and arguments into this command’s help page.
term_width: Option<usize>Fixed help width. Zero disables wrapping.
max_term_width: Option<usize>Maximum detected terminal width when term_width is unset. Zero disables the cap.
args_override_self: boolWhether later single-valued occurrences replace earlier ones.
before_help: Option<&'a str>Text printed above the usage line, and below everything else.
The spec’s before_help/after_help and their long forms. mise puts an Examples
section in after_long_help on 115 commands, which is where the reference renders it
from — so a help page without these is missing the part a reader came for.
before_long_help: Option<&'a str>§after_help: Option<&'a str>§after_long_help: Option<&'a str>§examples: &'a [Example<'a>]§headings: &'a [HeadingMeta<'a>]Prose for this command’s help sections, by heading title.
outputs: &'a [OutputMeta<'a>]What this command writes, and how a consumer should read it.
select: Option<&'a str>The flag whose value picks among Self::outputs, e.g. --format.
exit_codes: &'a [ExitCodeMeta<'a>]What this command’s exit statuses mean.
flags: &'a [FlagMeta<'a>]Metadata for cmd.flags, in the same order.
args: &'a [ArgMeta<'a>]Metadata for cmd.args, in the same order.
subcommands: &'a [&'a CommandMeta<'a>]Metadata for cmd.subcommands, in the same order.
groups: &'a [GroupMeta<'a>]Sets of this command’s flags that relate to one another as a set.
Cold like everything else here: a group is checked once the last token has been read, by code the derive generates, and a successful parse never reads this.
flatten_groups: &'a [FlattenGroup<'a>]Which runs of Self::flags came from a flattened Args type.
Only Spec::to_kdl reads this, and only to write a flagset once instead of the
same flags under every command that flattens the struct. It changes nothing about
parsing: the flags are in flags either way, which is why this is a description of
where they came from rather than a table anything binds against.
Implementations§
Source§impl CommandMeta<'_>
impl CommandMeta<'_>
Sourcepub const EMPTY: CommandMeta<'static>
pub const EMPTY: CommandMeta<'static>
Metadata for a command with nothing declared, for struct update syntax.
Trait Implementations§
Source§impl<'a> Clone for CommandMeta<'a>
impl<'a> Clone for CommandMeta<'a>
Source§fn clone(&self) -> CommandMeta<'a>
fn clone(&self) -> CommandMeta<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more