# Struct clap::SubCommand [−] [src]

    pub struct SubCommand<'n, 'a> {
        // some fields omitted
    }

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).

# Examples

    SubCommand::with_name("config")
                   .about("Used for configuration")
                   .arg(Arg::with_name("config_file")
                              .help("The configuration file to use")
                              .index(1))

## Methods

### `impl<'n, 'a> SubCommand<'n, 'a>`

#### `fn with_name<'au, 'v, 'ab, 'u, 'h, 'ar>(name: &'ar str) -> App<'au, 'v, 'ab, 'u, 'h, 'ar>`

Creates a new instance of a subcommand requiring a name. Will be displayed to the user when they print version or help and usage information.

# Examples

    SubCommand::with_name("config")

## Trait Implementations

### Derived Implementations

### `impl<'n, 'a> Debug for SubCommand<'n, 'a>`

#### `fn fmt(&self, __arg_0: &mut Formatter) -> Result`

# Help

## Keyboard Shortcuts

?
  Show this help dialog
S
  Focus the search field
⇤
  Move up in search results
⇥
  Move down in search results
⏎
  Go to active search result

## Search Tricks

Prefix searches with a type followed by a colon (e.g. `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct`, `enum`, `trait`, `type`, `macro`, and `const`.

Search functions by type signature (e.g. `vec -> usize` or `* -> vec`)