(command, help, entrypoint)
return decorator
Function decorator to simplify adding arguments to subcommands

    :param command: name of the subcommand to add
    :param help: help string for the subcommand
    :param entrypoint: the 'main' function for the subcommand to execute
Function decorator to simplify adding arguments to subcommands
Function decorator to simplify adding arguments to subcommands
def subparser(command, help, entrypoint):  # pragma: no cover
    """ Function decorator to simplify adding arguments to subcommands

    :param command: name of the subcommand to add
    :param help: help string for the subcommand
    :param entrypoint: the 'main' function for the subcommand to execute
    """

    def decorator(add_args):
        def wrapper(subparser):
            subparser = subparser.add_parser(command, formatter_class=help_formatter, add_help=False)
            required_named_args = subparser.add_argument_group("required arguments")
            optional_named_args = subparser.add_argument_group("optional arguments")
            add_args(subparser, required_named_args, optional_named_args)
            optional_named_args.add_argument("-h", "--help", action="help", help="show this message and exit")
            subparser.set_defaults(entrypoint=entrypoint)

        return wrapper

    return decorator
def subparser ( command , help , entrypoint ) : # pragma: no cover def decorator ( add_args ) : def wrapper ( subparser ) : subparser = subparser . add_parser ( command , formatter_class = help_formatter , add_help = False ) required_named_args = subparser . add_argument_group ( "required arguments" ) optional_named_args = subparser . add_argument_group ( "optional arguments" ) add_args ( subparser , required_named_args , optional_named_args ) optional_named_args . add_argument ( "-h" , "--help" , action = "help" , help = "show this message and exit" ) subparser . set_defaults ( entrypoint = entrypoint ) return wrapper return decorator