From 49cce5fa1a87e42be3ba5cd087f20413d33b087b Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Thu, 26 May 2022 22:52:03 +0200 Subject: [PATCH] Extended cpl new options --- src/cpl_cli/command/new_service.py | 17 ++++++++++++++--- src/cpl_cli/startup_argument_extension.py | 3 ++- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/cpl_cli/command/new_service.py b/src/cpl_cli/command/new_service.py index f8b5781e..3f1857c2 100644 --- a/src/cpl_cli/command/new_service.py +++ b/src/cpl_cli/command/new_service.py @@ -276,18 +276,29 @@ class NewService(CommandABC): :param args: :return: """ + if 'nothing' in args: + self._use_async = False + self._use_application_api = False + self._use_startup = False + self._use_service_providing = False + if 'async' in args: + args.remove('async') + if 'application-base' in args: + args.remove('application-base') + if 'startup' in args: + args.remove('startup') + if 'service-providing' in args: + args.remove('service-providing') + if 'async' in args: self._use_async = True args.remove('async') - if 'application-base' in args: self._use_application_api = True args.remove('application-base') - if 'startup' in args: self._use_startup = True args.remove('startup') - if 'service-providing' in args: self._use_service_providing = True args.remove('service-providing') diff --git a/src/cpl_cli/startup_argument_extension.py b/src/cpl_cli/startup_argument_extension.py index 64710b11..01f89e2c 100644 --- a/src/cpl_cli/startup_argument_extension.py +++ b/src/cpl_cli/startup_argument_extension.py @@ -90,7 +90,8 @@ class StartupArgumentExtension(StartupExtensionABC): .add_console_argument(ArgumentTypeEnum.Flag, '--', 'async', ['a', 'A']) \ .add_console_argument(ArgumentTypeEnum.Flag, '--', 'application-base', ['ab', 'AB']) \ .add_console_argument(ArgumentTypeEnum.Flag, '--', 'startup', ['s', 'S']) \ - .add_console_argument(ArgumentTypeEnum.Flag, '--', 'service-providing', ['sp', 'SP']) + .add_console_argument(ArgumentTypeEnum.Flag, '--', 'service-providing', ['sp', 'SP']) \ + .add_console_argument(ArgumentTypeEnum.Flag, '--', 'nothing', ['n', 'N']) config.create_console_argument(ArgumentTypeEnum.Executable, '', 'publish', ['p', 'P'], PublishService, True, validators=[ProjectValidator]) config.create_console_argument(ArgumentTypeEnum.Executable, '', 'remove', ['r', 'R'], RemoveService, True, validators=[WorkspaceValidator]) \ .add_console_argument(ArgumentTypeEnum.Flag, '--', 'simulate', ['s', 'S'])