Improved help command

This commit is contained in:
2021-03-03 19:47:55 +01:00
parent 2174cf3701
commit d5975ea7ba
3 changed files with 25 additions and 29 deletions

View File

@@ -19,6 +19,7 @@ class CLI(ApplicationABC):
self._command_handler: CommandHandler = self._services.get_service(CommandHandler)
# self._command_handler.add_command(Command('build', ['b', 'B']))
# self._command_handler.add_command(Command('generate', ['g', 'G']))
self._command_handler.add_command(Command('help', ['h', 'H'], self._services.get_service(Help)))
# self._command_handler.add_command(Command('new', ['n', 'N']))
# self._command_handler.add_command(Command('publish', ['p', 'P']))

View File

@@ -11,9 +11,12 @@ class Help(ServiceABC):
Console.write_line('Available Commands:')
commands = [
['build (-b|-B)', 'Prepares files for publishing into an output directory named dist/ at the given output path. Must be executed from within a workspace directory.'],
['generate (-g|-G)', 'Generate a new file.'],
['help (-h|-H)', 'Lists available commands and their short descriptions.'],
['new', 'Creates a new file or package.'],
['new (-n|-N)', 'Creates new CPL project.'],
['start (-s|-S)', 'Starts CPL project, restarting on file changes'],
['publish (-p|-P)', 'Prepares files for publishing into an output directory named dist/ at the given output path and executes setup.py. Must be executed from within a workspace directory.'],
['update (-u|-u)', 'Update CPL and project dependencies.'],
['version (-v|-V)', 'Outputs CPL CLI version.']
]
for name, description in commands: