main.py 文件源码

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

项目:deb-python-dcos 作者: openstack 项目源码 文件源码
def _main(argv):
    """The main function for the 'task' subcommand"""

    # We must special case the 'dcos task exec' subcommand in order to
    # allow us to pass arguments to docopt in a more user-friendly
    # manner. Specifically, we need to be able to to pass arguments
    # beginning with "-" to the command we are trying to launch with
    # 'exec' without docopt trying to match them to a named parameter
    # for the 'dcos' command itself.
    if len(argv) > 1 and argv[1] == "exec":
        args = docopt_wrapper(
            default_doc("task_exec"),
            default_doc("task"),
            argv=argv[2:],
            version="dcos-task version {}".format(dcoscli.version),
            options_first=True,
            base_subcommand="task",
            subcommand="exec")
    else:
        args = docopt.docopt(
            default_doc("task"),
            argv=argv,
            version="dcos-task version {}".format(dcoscli.version))

    return cmds.execute(_cmds(), args)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号