class documentation

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_subparsers Undocumented
Method convert_arg_line_to_args Undocumented
Method error error(message: string)
Method exit Undocumented
Method format_help Undocumented
Method format_usage Undocumented
Method parse_args Undocumented
Method parse_intermixed_args Undocumented
Method parse_known_args Undocumented
Method parse_known_intermixed_args Undocumented
Method print_help Undocumented
Method print_usage Undocumented
Instance Variable add_help Undocumented
Instance Variable allow_abbrev Undocumented
Instance Variable epilog Undocumented
Instance Variable exit_on_error Undocumented
Instance Variable formatter_class Undocumented
Instance Variable fromfile_prefix_chars Undocumented
Instance Variable prog Undocumented
Instance Variable usage Undocumented
Method _add_action Undocumented
Method _check_value Undocumented
Method _get_formatter Undocumented
Method _get_kwargs Undocumented
Method _get_nargs_pattern Undocumented
Method _get_option_tuples Undocumented
Method _get_optional_actions Undocumented
Method _get_positional_actions Undocumented
Method _get_value Undocumented
Method _get_values Undocumented
Method _match_argument Undocumented
Method _match_arguments_partial Undocumented
Method _parse_known_args Undocumented
Method _parse_optional Undocumented
Method _print_message Undocumented
Method _read_args_from_files Undocumented
Instance Variable _optionals Undocumented
Instance Variable _positionals Undocumented
Instance Variable _subparsers Undocumented

Inherited from _AttributeHolder:

Method __repr__ Undocumented
Method _get_args Undocumented

Inherited from _ActionsContainer (via _AttributeHolder):

Method add_argument add_argument(dest, ..., name=value, ...) add_argument(option_string, option_string, ..., name=value, ...)
Method add_argument_group Undocumented
Method add_mutually_exclusive_group Undocumented
Method get_default Undocumented
Method register Undocumented
Method set_defaults Undocumented
Instance Variable argument_default Undocumented
Instance Variable conflict_handler Undocumented
Instance Variable description Undocumented
Instance Variable prefix_chars Undocumented
Method _add_container_actions Undocumented
Method _check_conflict Undocumented
Method _get_handler Undocumented
Method _get_optional_kwargs Undocumented
Method _get_positional_kwargs Undocumented
Method _handle_conflict_error Undocumented
Method _handle_conflict_resolve Undocumented
Method _pop_action_class Undocumented
Method _registry_get Undocumented
Method _remove_action Undocumented
Instance Variable _action_groups Undocumented
Instance Variable _actions Undocumented
Instance Variable _defaults Undocumented
Instance Variable _has_negative_number_optionals Undocumented
Instance Variable _mutually_exclusive_groups Undocumented
Instance Variable _negative_number_matcher Undocumented
Instance Variable _option_string_actions 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)
def add_subparsers(self, **kwargs): (source)

Undocumented

def convert_arg_line_to_args(self, arg_line): (source)

Undocumented

def error(self, message): (source)

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.

def exit(self, status=0, message=None): (source)

Undocumented

def format_help(self): (source)

Undocumented

def format_usage(self): (source)

Undocumented

def parse_args(self, args=None, namespace=None): (source)

Undocumented

def parse_intermixed_args(self, args=None, namespace=None): (source)

Undocumented

def parse_known_args(self, args=None, namespace=None): (source)

Undocumented

def parse_known_intermixed_args(self, args=None, namespace=None): (source)

Undocumented

def print_help(self, file=None): (source)

Undocumented

def print_usage(self, file=None): (source)

Undocumented

add_help = (source)

Undocumented

allow_abbrev = (source)

Undocumented

Undocumented

exit_on_error = (source)

Undocumented

formatter_class = (source)

Undocumented

fromfile_prefix_chars = (source)

Undocumented

Undocumented

Undocumented

def _add_action(self, action): (source)
def _check_value(self, action, value): (source)

Undocumented

def _get_formatter(self): (source)

Undocumented

def _get_kwargs(self): (source)

Undocumented

def _get_nargs_pattern(self, action): (source)

Undocumented

def _get_option_tuples(self, option_string): (source)

Undocumented

def _get_optional_actions(self): (source)

Undocumented

def _get_positional_actions(self): (source)

Undocumented

def _get_value(self, action, arg_string): (source)

Undocumented

def _get_values(self, action, arg_strings): (source)

Undocumented

def _match_argument(self, action, arg_strings_pattern): (source)

Undocumented

def _match_arguments_partial(self, actions, arg_strings_pattern): (source)

Undocumented

def _parse_known_args(self, arg_strings, namespace): (source)

Undocumented

def _parse_optional(self, arg_string): (source)

Undocumented

def _print_message(self, message, file=None): (source)

Undocumented

def _read_args_from_files(self, arg_strings): (source)

Undocumented

_optionals = (source)

Undocumented

_positionals = (source)

Undocumented

_subparsers = (source)

Undocumented