pub struct Command {Show 17 fields
pub name: &'static str,
pub about: &'static str,
pub long_about: &'static str,
pub after_help: &'static str,
pub after_long_help: &'static str,
pub items: &'static [Item],
pub subcommands: &'static [Sub],
pub subcommand_required: bool,
pub help_flag: bool,
pub help_short: bool,
pub version: Option<&'static str>,
pub default_subcommand: Option<&'static str>,
pub default_subcommand_flags: bool,
pub default_subcommand_help: bool,
pub flatten_help: bool,
pub examples: &'static [Example],
pub headings: &'static [Heading],
}Expand description
Fields§
§name: &'static strThe command’s own name; empty for a root that leaves it to argv[0].
about: &'static strFirst paragraph of the description.
long_about: &'static strThe whole description, for --help.
after_help: &'static strText after the lists, for -h.
after_long_help: &'static strText after the lists, for --help.
items: &'static [Item]Flags and positionals, in declaration order.
subcommands: &'static [Sub]Subcommands, in declaration order.
subcommand_required: boolWhether a subcommand must be given.
help_flag: boolWhether --help is supplied (not declared or disabled).
help_short: boolWhether the supplied help flag has -h as well as --help.
version: Option<&'static str>The version, when -V/--version are supplied.
default_subcommand: Option<&'static str>The subcommand a line that names none runs: marked (default) in
the list.
default_subcommand_flags: boolWhether a flag this command does not take selects the default subcommand too.
default_subcommand_help: boolWhether the default subcommand’s page follows this one.
flatten_help: boolWhether each subcommand’s usage line, description and arguments stand where the list of subcommands would.
examples: &'static [Example]Command lines to try, in an Examples section.
headings: &'static [Heading]What --help says under a heading, before its entries.