__main__.py 文件源码

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

项目:envmgr-cli 作者: trainline 项目源码 文件源码
def main():
    """Main CLI entrypoint."""
    options = docopt(__doc__, version=VERSION)
    setup_logger(options.get('--verbose', False))
    priority_order = ["cycle", "asg", "instances", "deploy", "patch", "toggle", "upstream", "publish", "verify", "service"]
    cmd_opts = options.copy()

    if cmd_opts["<service>"] is not None:
        cmd_opts["service"] = True

    for cmd in priority_order:
        if cmd_opts[cmd]:
            logging.info('Running {0} command'.format(cmd))
            CommandClass = commands[cmd]
            command = CommandClass(options)
            return command.run()

    print("Unknown command")

# Allow local execution for debugging
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号