zut.command.CommandParser
- class zut.command.CommandParser(prog=None, usage=None, description=None, epilog=None, parents=[], formatter_class=<class 'argparse.HelpFormatter'>, prefix_chars='-', fromfile_prefix_chars=None, argument_default=None, conflict_handler='error', add_help=True, allow_abbrev=True, exit_on_error=True)
Bases:
ArgumentParser- __init__(prog=None, usage=None, description=None, epilog=None, parents=[], formatter_class=<class 'argparse.HelpFormatter'>, prefix_chars='-', fromfile_prefix_chars=None, argument_default=None, conflict_handler='error', add_help=True, allow_abbrev=True, exit_on_error=True)
Methods
__init__([prog, usage, description, epilog, ...])add_argument_group(*args, **kwargs)add_mutually_exclusive_group(**kwargs)add_subparsers(**kwargs)convert_arg_line_to_args(arg_line)error(message)Prints a usage message incorporating the message to stderr and exits.
exit([status, message])format_help()format_usage()get_default(dest)parse_args([args, namespace])parse_intermixed_args([args, namespace])parse_known_args([args, namespace])parse_known_intermixed_args([args, namespace])print_help([file])print_usage([file])register(registry_name, value, object)set_defaults(**kwargs)Attributes
param_helps- add_argument(dest, ..., name=value, ...)
- add_argument(option_string, option_string, ..., name=value, ...)
- 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.