Struct clap::SubCommand
source · pub struct SubCommand<'a> {
pub name: String,
pub matches: ArgMatches<'a>,
}Expand description
The abstract representation of a command line subcommand used by the consumer of the library.
This struct is used by the library consumer and describes all the valid options of the subcommand for their program. SubCommands are treated like “sub apps” and contain all the same possibilities (such as their own arguments and subcommands).
§Example
SubCommand::new("conifg")
.about("Used for configuration")
.arg(Arg::new("config_file")
.help("The configuration file to use")
.index(1))Fields§
§name: String§matches: ArgMatches<'a>Implementations§
Auto Trait Implementations§
impl<'a> Freeze for SubCommand<'a>
impl<'a> RefUnwindSafe for SubCommand<'a>
impl<'a> Send for SubCommand<'a>
impl<'a> Sync for SubCommand<'a>
impl<'a> Unpin for SubCommand<'a>
impl<'a> UnwindSafe for SubCommand<'a>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more