def command(name=None, cls=None, **attrs):
if cls is None:<EOL><INDENT>cls = Command<EOL><DEDENT>def decorator(f):<EOL><INDENT>cmd = _make_command(f, name, attrs, cls)<EOL>cmd.__doc__ = f.__doc__<EOL>return cmd<EOL><DEDENT>return decorator<EOL>
Creates a new :class:`Command` and uses the decorated function as
    callback.  This will also automatically attach all decorated
    :func:`option`\s and :func:`argument`\s as parameters to the command.

    The name of the command defaults to the name of the function.  If you
    want to change that, you can pass the intended name as the first
    argument.

    All keyword arguments are forwarded to the underlying command class.

    Once decorated the function turns into a :class:`Command` instance
    that can be invoked as a command line utility or be attached to a
    command :class:`Group`.

    :param name: the name of the command.  This defaults to the function
                 name.
    :param cls: the command class to instantiate.  This defaults to
                :class:`Command`.