2022-05-19 18:09:25 +02:00
|
|
|
from cpl_cli.command.add_service import AddService
|
|
|
|
from cpl_cli.command.build_service import BuildService
|
|
|
|
from cpl_cli.command.generate_service import GenerateService
|
|
|
|
from cpl_cli.command.help_service import HelpService
|
|
|
|
from cpl_cli.command.install_service import InstallService
|
|
|
|
from cpl_cli.command.new_service import NewService
|
|
|
|
from cpl_cli.command.publish_service import PublishService
|
|
|
|
from cpl_cli.command.remove_service import RemoveService
|
2022-05-25 08:41:35 +02:00
|
|
|
from cpl_cli.command.run_service import RunService
|
2022-05-19 18:09:25 +02:00
|
|
|
from cpl_cli.command.start_service import StartService
|
|
|
|
from cpl_cli.command.uninstall_service import UninstallService
|
|
|
|
from cpl_cli.command.update_service import UpdateService
|
|
|
|
from cpl_cli.command.version_service import VersionService
|
2022-05-20 10:27:55 +02:00
|
|
|
from cpl_cli.validators.project_validator import ProjectValidator
|
|
|
|
from cpl_cli.validators.workspace_validator import WorkspaceValidator
|
2022-05-22 20:27:58 +02:00
|
|
|
from cpl_core.application.startup_extension_abc import StartupExtensionABC
|
2022-05-19 18:09:25 +02:00
|
|
|
from cpl_core.configuration.argument_type_enum import ArgumentTypeEnum
|
|
|
|
from cpl_core.configuration.configuration_abc import ConfigurationABC
|
|
|
|
from cpl_core.dependency_injection.service_collection_abc import ServiceCollectionABC
|
2022-05-22 20:27:58 +02:00
|
|
|
from cpl_core.environment.application_environment_abc import ApplicationEnvironmentABC
|
2022-05-19 18:09:25 +02:00
|
|
|
|
|
|
|
|
|
|
|
class StartupArgumentExtension(StartupExtensionABC):
|
|
|
|
|
|
|
|
def __init__(self):
|
|
|
|
pass
|
|
|
|
|
|
|
|
def configure_configuration(self, config: ConfigurationABC, env: ApplicationEnvironmentABC):
|
2022-05-24 19:20:55 +02:00
|
|
|
config.create_console_argument(ArgumentTypeEnum.Executable, '', 'add', ['a', 'A'], AddService, True, validators=[WorkspaceValidator]) \
|
2022-05-19 18:09:25 +02:00
|
|
|
.add_console_argument(ArgumentTypeEnum.Flag, '--', 'simulate', ['s', 'S'])
|
2022-05-20 10:27:55 +02:00
|
|
|
config.create_console_argument(ArgumentTypeEnum.Executable, '', 'build', ['b', 'B'], BuildService, True, validators=[ProjectValidator])
|
2022-05-20 09:10:29 +02:00
|
|
|
config.create_console_argument(ArgumentTypeEnum.Executable, '', 'generate', ['g', 'G'], GenerateService, True) \
|
2022-05-19 18:09:25 +02:00
|
|
|
.add_console_argument(ArgumentTypeEnum.Variable, '', 'abc', ['a', 'A'], ' ') \
|
|
|
|
.add_console_argument(ArgumentTypeEnum.Variable, '', 'class', ['c', 'C'], ' ') \
|
|
|
|
.add_console_argument(ArgumentTypeEnum.Variable, '', 'enum', ['e', 'E'], ' ') \
|
2022-05-25 17:07:22 +02:00
|
|
|
.add_console_argument(ArgumentTypeEnum.Variable, '', 'pipe', ['p', 'P'], ' ') \
|
2022-05-19 18:09:25 +02:00
|
|
|
.add_console_argument(ArgumentTypeEnum.Variable, '', 'service', ['s', 'S'], ' ') \
|
|
|
|
.add_console_argument(ArgumentTypeEnum.Variable, '', 'settings', ['st', 'ST'], ' ') \
|
2022-05-26 13:17:58 +02:00
|
|
|
.add_console_argument(ArgumentTypeEnum.Variable, '', 'test_case', ['tc', 'TC'], ' ') \
|
2022-05-20 10:34:09 +02:00
|
|
|
.add_console_argument(ArgumentTypeEnum.Variable, '', 'thread', ['t', 'T'], ' ') \
|
|
|
|
.add_console_argument(ArgumentTypeEnum.Variable, '', 'validator', ['v', 'V'], ' ')
|
2022-05-24 19:20:55 +02:00
|
|
|
config.create_console_argument(ArgumentTypeEnum.Executable, '', 'install', ['i', 'I'], InstallService, True, validators=[ProjectValidator]) \
|
2022-05-19 18:09:25 +02:00
|
|
|
.add_console_argument(ArgumentTypeEnum.Flag, '--', 'virtual', ['v', 'V']) \
|
|
|
|
.add_console_argument(ArgumentTypeEnum.Flag, '--', 'simulate', ['s', 'S'])
|
2022-05-20 09:10:29 +02:00
|
|
|
config.create_console_argument(ArgumentTypeEnum.Executable, '', 'new', ['n', 'N'], NewService, True) \
|
2022-05-19 18:09:25 +02:00
|
|
|
.add_console_argument(ArgumentTypeEnum.Variable, '', 'console', ['c', 'C'], ' ') \
|
2022-05-26 13:12:35 +02:00
|
|
|
.add_console_argument(ArgumentTypeEnum.Variable, '', 'library', ['l', 'L'], ' ') \
|
2022-05-26 21:18:57 +02:00
|
|
|
.add_console_argument(ArgumentTypeEnum.Variable, '', 'unittest', ['ut', 'UT'], ' ') \
|
|
|
|
.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']) \
|
2022-05-26 22:52:03 +02:00
|
|
|
.add_console_argument(ArgumentTypeEnum.Flag, '--', 'service-providing', ['sp', 'SP']) \
|
|
|
|
.add_console_argument(ArgumentTypeEnum.Flag, '--', 'nothing', ['n', 'N'])
|
2022-05-24 19:20:55 +02:00
|
|
|
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]) \
|
2022-05-19 18:09:25 +02:00
|
|
|
.add_console_argument(ArgumentTypeEnum.Flag, '--', 'simulate', ['s', 'S'])
|
2022-05-25 08:41:35 +02:00
|
|
|
config.create_console_argument(ArgumentTypeEnum.Executable, '', 'run', [], RunService, True, validators=[ProjectValidator])
|
2022-05-24 19:20:55 +02:00
|
|
|
config.create_console_argument(ArgumentTypeEnum.Executable, '', 'start', ['s', 'S'], StartService, True, validators=[ProjectValidator])
|
|
|
|
config.create_console_argument(ArgumentTypeEnum.Executable, '', 'uninstall', ['ui', 'UI'], UninstallService, True, validators=[ProjectValidator]) \
|
2022-05-19 18:09:25 +02:00
|
|
|
.add_console_argument(ArgumentTypeEnum.Flag, '--', 'virtual', ['v', 'V']) \
|
|
|
|
.add_console_argument(ArgumentTypeEnum.Flag, '--', 'simulate', ['s', 'S'])
|
2022-05-24 19:20:55 +02:00
|
|
|
config.create_console_argument(ArgumentTypeEnum.Executable, '', 'update', ['u', 'U'], UpdateService, True, validators=[ProjectValidator]) \
|
2022-05-19 19:37:32 +02:00
|
|
|
.add_console_argument(ArgumentTypeEnum.Flag, '--', 'simulate', ['s', 'S'])
|
2022-05-20 09:10:29 +02:00
|
|
|
config.create_console_argument(ArgumentTypeEnum.Executable, '', 'version', ['v', 'V'], VersionService, True)
|
2022-05-19 18:09:25 +02:00
|
|
|
|
2022-05-20 10:27:55 +02:00
|
|
|
config.for_each_argument(lambda a: a.add_console_argument(ArgumentTypeEnum.Flag, '--', 'help', ['h', 'H']))
|
2022-05-19 18:09:25 +02:00
|
|
|
config.create_console_argument(ArgumentTypeEnum.Executable, '', 'help', ['h', 'H'], HelpService)
|
|
|
|
|
2022-05-19 20:21:46 +02:00
|
|
|
def configure_services(self, services: ServiceCollectionABC, env: ApplicationEnvironmentABC):
|
2022-06-27 10:52:26 +02:00
|
|
|
pass
|