help.py 文件源码

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

项目:bay 作者: eventbrite 项目源码 文件源码
def help(ctx, command_name):
    """
    Shows main command list.
    """
    from ..cli import cli
    # Find subcommand
    if command_name:
        subcommand = cli.get_command(None, command_name)
        if subcommand is None:
            click.echo(RED("There is no command {}".format(command_name)))
            sys.exit(1)
        else:
            # Override info name so help prints correctly
            ctx.info_name = subcommand.name
            click.echo(subcommand.get_help(ctx))
    # Print main help
    else:
        ctx.info_name = "bay"
        ctx.parent = None
        click.echo(cli.get_help(ctx))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号