Trait Subcommand

trait Subcommand: FromArgMatches + Sized

Parse a sub-command into a user-defined enum.

Implementing this trait lets a parent container delegate subcommand behavior to Self. with:

NOTE: Deriving requires the derive feature flag

Required Methods

fn augment_subcommands(cmd: Command) -> Command

Append to Command so it can instantiate Self via FromArgMatches::from_arg_matches_mut

This is used to implement #[command(flatten)]

See also CommandFactory::command.

fn augment_subcommands_for_update(cmd: Command) -> Command

Append to Command so it can instantiate self via FromArgMatches::update_from_arg_matches_mut

This is used to implement #[command(flatten)]

See also CommandFactory::command_for_update.

fn has_subcommand(name: &str) -> bool

Test whether Self can parse a specific subcommand

Implementors