diff --git a/kiwi_scp/commands/cli.py b/kiwi_scp/commands/cli.py index 755162d..2d01adf 100644 --- a/kiwi_scp/commands/cli.py +++ b/kiwi_scp/commands/cli.py @@ -194,4 +194,5 @@ class KiwiCommand: class KiwiCommandType(Enum): INSTANCE = auto() PROJECT = auto() + PROJECTS = auto() SERVICE = auto() diff --git a/kiwi_scp/commands/decorators.py b/kiwi_scp/commands/decorators.py index 04e470f..61777b1 100644 --- a/kiwi_scp/commands/decorators.py +++ b/kiwi_scp/commands/decorators.py @@ -11,13 +11,27 @@ _pass_instance = click.make_pass_decorator( ) _project_arg = click.argument( + "project_name", + metavar="PROJECT", + required=False, # TODO remove this line when PROJECTS logic is implemented + type=str, +) + +_projects_arg = click.argument( + "project_names", + metavar="[PROJECT]...", + nargs=-1, + type=str, +) + +_services_arg_p = click.argument( "project_name", metavar="[PROJECT]", required=False, type=str, ) -_services_arg = click.argument( +_services_arg_s = click.argument( "service_names", metavar="[SERVICE]...", nargs=-1, @@ -46,9 +60,12 @@ def kiwi_command( if cmd_type is KiwiCommandType.PROJECT: cmd = _project_arg(cmd) + elif cmd_type is KiwiCommandType.PROJECTS: + cmd = _projects_arg(cmd) + elif cmd_type is KiwiCommandType.SERVICE: - cmd = _project_arg(cmd) - cmd = _services_arg(cmd) + cmd = _services_arg_p(cmd) + cmd = _services_arg_s(cmd) return cmd