Added logic to add CLI commands from external packages
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import sys
|
||||
import traceback
|
||||
|
||||
from cpl_cli.error import Error
|
||||
from cpl_core.application.application_abc import ApplicationABC
|
||||
from cpl_core.configuration.configuration_abc import ConfigurationABC
|
||||
from cpl_core.console.console import Console
|
||||
@@ -26,7 +27,16 @@ class CLI(ApplicationABC):
|
||||
:return:
|
||||
"""
|
||||
try:
|
||||
self._configuration.parse_console_arguments(self._services)
|
||||
result = self._configuration.parse_console_arguments(self._services)
|
||||
if result:
|
||||
return
|
||||
|
||||
if len(self._configuration.additional_arguments) == 0:
|
||||
Error.error('Expected command')
|
||||
return
|
||||
|
||||
unexpected_arguments = ', '.join(self._configuration.additional_arguments)
|
||||
Error.error(f'Unexpected argument(s): {unexpected_arguments}')
|
||||
except KeyboardInterrupt:
|
||||
Console.write_line()
|
||||
sys.exit()
|
||||
|
||||
Reference in New Issue
Block a user