dispatcher.py 文件源码

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

项目:rcli 作者: contains-io 项目源码 文件源码
def _get_command_and_argv(argv):
    # type: (typing.List[str]) -> typing.Tuple[str, typing.List[str]]
    """Extract the command name and arguments to pass to docopt.

    Args:
        argv: The argument list being used to run the command.

    Returns:
        A tuple containing the name of the command and the arguments to pass
        to docopt.
    """
    command_name = argv[0]
    if not command_name:
        argv = argv[1:]
    elif command_name == settings.command:
        argv.remove(command_name)
    return command_name, argv
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号