Module clap
Command line argument parsing.
clap is a powerful and feature-rich command-line argument parser
that provides a polished CLI experience out-of-the-box.
It supports two primary API approaches: the derive API for simplicity
and the builder API for maximum flexibility.
Examples
Simple command-line tool using the derive API:
use Parser;
Application with subcommands:
use ;
Modules
Structs
- Arg The abstract representation of a command line argument. Used to set all the options and relationships that define a valid argument for the program.
- ArgGroup Specifies a logical group of [arguments]
- ArgMatches Container for parse results.
- Command Build a command-line interface.
-
Id
[
Arg][crate::Arg] or [ArgGroup][crate::ArgGroup] identifier
Enums
- ArgAction Behavior of arguments when they are encountered while parsing
- ColorChoice Represents the color preferences for program output
- ValueHint Provide shell with hint on how to complete an argument.
Traits
- Args Parse a set of arguments into a user-defined container.
-
CommandFactory
Create a
Commandrelevant for a user-defined container. -
FromArgMatches
Converts an instance of
ArgMatchesto a user-defined container. -
Parser
Parse command-line arguments into
Self. - Subcommand Parse a sub-command into a user-defined enum.
- ValueEnum Parse arguments into enums.
Type Aliases
- Error Command Line Argument Parser Error
Macros
-
arg
Create an
Argfrom a usage string. -
command
Requires
cargofeature flag to be enabled. -
value_parser
Select a
ValueParserimplementation from the intended type