def handle_options_and_args(_command, arguments, options):
for argument in arguments:
if isinstance(argument, dict):
_command = click.argument(
list(argument.keys())[0],
**handle_option_and_arg_data(list(argument.values())[0])
)(_command)
else:
_command = click.argument(argument)(_command)
if isinstance(options, dict):
for name, data in options.items():
data = handle_option_and_arg_data(data)
_command = click.option(name, **data)(_command)
else:
for name in options:
_command = click.option(name)(_command)
return _command
评论列表
文章目录