def command(*args, **kwargs):
def decorator(f):<EOL><INDENT>if '<STR_LIT:description>' not in kwargs:<EOL><INDENT>kwargs['<STR_LIT:description>'] = f.__doc__<EOL><DEDENT>if '<STR_LIT>' in kwargs:<EOL><INDENT>if not hasattr(f, '<STR_LIT>'):  <EOL><INDENT>f._argnames = []<EOL><DEDENT>for p in kwargs['<STR_LIT>']:<EOL><INDENT>f._argnames += p._argnames if hasattr(p, '<STR_LIT>') else []<EOL><DEDENT>kwargs['<STR_LIT>'] = [p.parser for p in kwargs['<STR_LIT>']]<EOL><DEDENT>f.parser = argparse.ArgumentParser(*args, **kwargs)<EOL>f.climax = True<EOL>for arg in getattr(f, '<STR_LIT>', []):<EOL><INDENT>f.parser.add_argument(*arg[<NUM_LIT:0>], **arg[<NUM_LIT:1>])<EOL><DEDENT>@wraps(f)<EOL>def wrapper(args=None):<EOL><INDENT>kwargs = f.parser.parse_args(args)<EOL>return f(**vars(kwargs))<EOL><DEDENT>wrapper.func = f<EOL>return wrapper<EOL><DEDENT>return decorator<EOL>
Decorator to define a command.

    The arguments to this decorator are those of the
    `ArgumentParser <https://docs.python.org/3/library/argparse.html\
argumentparser-objects>`_
    object constructor.