1
0
Fork 0
mirror of https://github.com/yavook/kiwi-scp.git synced 2024-11-24 13:43:01 +00:00
This commit is contained in:
Jörn-Michael Miehe 2021-10-21 10:34:53 +02:00
parent a787f515dd
commit a41843c9b2

View file

@ -16,32 +16,23 @@ class _MultiDecorator:
return target return target
_instance_args = [] _project_arg = click.argument(
instance_command = _MultiDecorator(_instance_args)
_project_args = [
*_instance_args,
click.argument(
"project", "project",
required=False, required=False,
type=click.Path(exists=True), type=click.Path(exists=True),
default=".", default=".",
), )
]
project_command = _MultiDecorator(_project_args) _service_arg = click.argument(
_service_args = [
*_project_args,
click.argument(
"service", "service",
required=False, required=False,
type=str, type=str,
), )
]
instance_command = _MultiDecorator([])
project_command = _MultiDecorator([_project_arg])
service_command = _MultiDecorator([_project_arg, _service_arg])
service_command = _MultiDecorator(_service_args)
def user_query(description: str, default: Any, cast_to: Type[Any] = str): def user_query(description: str, default: Any, cast_to: Type[Any] = str):