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
评论列表
文章目录