Useful utilities for command-line arguments.
Functions
| add_arg(*args, **kwargs) | Add an argparse argument. |
| add_arg_group(*args, **kwargs) | Add an argparse argument group. |
| add_command(*args, **kwargs) | Add an argparse command parser. |
| add_mutex_arg_group(*args, **kwargs) | Add a mutually-exclusive argparse group. |
| annotate(*args, **kwargs) | Return a decorator for plac-style argument annotations. |
| parse_args(**overrides) | Parse command-line arguments, overriding with keyword arguments. |
Classes
| Parser(*args, **kwargs) | This class provides some sane default command-line argument behaviors. |
This class provides some sane default command-line argument behaviors.
In particular, the help formatter includes default values, and arguments can be loaded from files. Files can contain arguments in two ways: one per line, or many-per-line. For one-per-line arguments, spaces etc. are preserved, while for many-per-line arguments, the line must start with a dash, and multiple arguments are split on whitespace. In all cases, shell-style comments are removed from the file before processing.
Add an argparse argument group.
| Returns: | An argparse argument group object. |
|---|
Add an argparse command parser.
The name of the command will be stored in the “command_name” argparse variable.
| Returns: | An argparse command parser object. |
|---|
Add a mutually-exclusive argparse group.
| Returns: | A mutually-exclusive argparse argument group object. |
|---|