class documentation
class ArgumentParser(_AttributeHolder, _ActionsContainer): (source)
Known subclasses: configargparse.ArgumentParser
Constructor: ArgumentParser(prog, usage, description, epilog, ...)
Object for parsing command line strings into Python objects.
- Keyword Arguments:
- prog -- The name of the program (default: sys.argv[0])
- usage -- A usage message (default: auto-generated from arguments)
- description -- A description of what the program does
- epilog -- Text following the argument descriptions
- parents -- Parsers whose arguments should be copied into this one
- formatter_class -- HelpFormatter class for printing help messages
- prefix_chars -- Characters that prefix optional arguments
- fromfile_prefix_chars -- Characters that prefix files containing
- additional arguments
- argument_default -- The default value for all arguments
- conflict_handler -- String indicating how to handle conflicts
- add_help -- Add a -h/-help option
- allow_abbrev -- Allow long options to be abbreviated unambiguously
- exit_on_error -- Determines whether or not ArgumentParser exits with
- error info when an error occurs
Method | __init__ |
Undocumented |
Method | add |
Undocumented |
Method | convert |
Undocumented |
Method | error |
error(message: string) |
Method | exit |
Undocumented |
Method | format |
Undocumented |
Method | format |
Undocumented |
Method | parse |
Undocumented |
Method | parse |
Undocumented |
Method | parse |
Undocumented |
Method | parse |
Undocumented |
Method | print |
Undocumented |
Method | print |
Undocumented |
Instance Variable | add |
Undocumented |
Instance Variable | allow |
Undocumented |
Instance Variable | epilog |
Undocumented |
Instance Variable | exit |
Undocumented |
Instance Variable | formatter |
Undocumented |
Instance Variable | fromfile |
Undocumented |
Instance Variable | prog |
Undocumented |
Instance Variable | usage |
Undocumented |
Method | _add |
Undocumented |
Method | _check |
Undocumented |
Method | _get |
Undocumented |
Method | _get |
Undocumented |
Method | _get |
Undocumented |
Method | _get |
Undocumented |
Method | _get |
Undocumented |
Method | _get |
Undocumented |
Method | _get |
Undocumented |
Method | _get |
Undocumented |
Method | _match |
Undocumented |
Method | _match |
Undocumented |
Method | _parse |
Undocumented |
Method | _parse |
Undocumented |
Method | _print |
Undocumented |
Method | _read |
Undocumented |
Instance Variable | _optionals |
Undocumented |
Instance Variable | _positionals |
Undocumented |
Instance Variable | _subparsers |
Undocumented |
Inherited from _AttributeHolder
:
Method | __repr__ |
Undocumented |
Method | _get |
Undocumented |
Inherited from _ActionsContainer
(via _AttributeHolder
):
Method | add |
add_argument(dest, ..., name=value, ...) add_argument(option_string, option_string, ..., name=value, ...) |
Method | add |
Undocumented |
Method | add |
Undocumented |
Method | get |
Undocumented |
Method | register |
Undocumented |
Method | set |
Undocumented |
Instance Variable | argument |
Undocumented |
Instance Variable | conflict |
Undocumented |
Instance Variable | description |
Undocumented |
Instance Variable | prefix |
Undocumented |
Method | _add |
Undocumented |
Method | _check |
Undocumented |
Method | _get |
Undocumented |
Method | _get |
Undocumented |
Method | _get |
Undocumented |
Method | _handle |
Undocumented |
Method | _handle |
Undocumented |
Method | _pop |
Undocumented |
Method | _registry |
Undocumented |
Method | _remove |
Undocumented |
Instance Variable | _action |
Undocumented |
Instance Variable | _actions |
Undocumented |
Instance Variable | _defaults |
Undocumented |
Instance Variable | _has |
Undocumented |
Instance Variable | _mutually |
Undocumented |
Instance Variable | _negative |
Undocumented |
Instance Variable | _option |
Undocumented |
Instance Variable | _registries |
Undocumented |
def __init__(self, prog=None, usage=None, description=None, epilog=None, parents=[], formatter_class=HelpFormatter, prefix_chars='-', fromfile_prefix_chars=None, argument_default=None, conflict_handler='error', add_help=True, allow_abbrev=True, exit_on_error=True):
(source)
¶
overrides
argparse._ActionsContainer.__init__
overridden in
configargparse.ArgumentParser
Undocumented
error(message: string)
Prints a usage message incorporating the message to stderr and exits.
If you override this in a subclass, it should not return -- it should either exit or raise an exception.