def class_args(cls):
    ap_ = ArgParseInator(skip_init=True)
    utils.collect_appendvars(ap_, cls)
    cls.__cls__ = cls
    cmds = {}
    cls.__arguments__ = getattr(cls, '__arguments__', [])
    for func in [f for f in cls.__dict__.values()
                 if hasattr(f, '__cmd_name__') and not inspect.isclass(f)]:
        func.__subcommands__ = None
        func.__cls__ = cls
        cmds[func.__cmd_name__] = func
    if hasattr(cls, '__cmd_name__') and cls.__cmd_name__ not in ap_.commands:
        cls.__subcommands__ = cmds
        ap_.commands[cls.__cmd_name__] = cls
    else:
        for name, func in cmds.items():
            if name not in ap_.commands:
                ap_.commands[name] = func
    return cls