Create a command, using the wrapped function as the handler.

    Args
    ----
    name : str
        Name given to the created Command instance.

    Returns
    -------
    Command
        A new instance of Command, with handler set to the wrapped function.

def command(name):
    """Create a command, using the wrapped function as the handler.

    Args
    ----
    name : str
        Name given to the created Command instance.

    Returns
    -------
    Command
        A new instance of Command, with handler set to the wrapped function.

    """
    # TODO(nick): It would be nice if this didn't transform the handler.  That
    #   way, handlers could be used and tested independently of this system.
    #   Unfortunately that's one of the better properties of the previous
    #   system that wasn't preserved in this rewrite.
    def wrapper(func):
        title, description = _parse_doc(func.__doc__)
        command = Command(name=name, title=title, description=description)
        command.add_handler(func)
        argparse_args_list = getattr(func, 'ARGPARSE_ARGS_LIST', [])
        for args, kwargs in argparse_args_list:
            command.add_argument_tuple((args, kwargs))
        return command
    return wrapper