help.py 文件源码

python
阅读 28 收藏 0 点赞 0 评论 0

项目:farmer 作者: vmfarms 项目源码 文件源码
def get_help_recursive(group, ctx, commands):
    """
    Returns help for arbitrarily nested subcommands of the given click.Group.
    """
    try:
        command_name = commands.pop(0)
        group = group.get_command(ctx, command_name)
        if not group:
            raise click.ClickException('Invalid command: {}'.format(command_name))
    except IndexError:
        # end of subcommand chain
        return group.get_help(ctx)
    except AttributeError:
        # group is actually a command with no children
        return group.get_help(ctx)
    return get_help_recursive(group, ctx, commands)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号