INNER CODE UNIT · Python
CommandParser
grycap/scar · scar/parser/cli/__init__.py:167
class CommandParser():
"""Class to manage the SCAR CLI commands."""
def __init__(self):
self.parser = _create_main_parser()
self.parent_parsers = _create_parent_parsers()
self._add_subparsers()
def _add_subparsers(self) -> None:
subparsers = Subparsers(self.parser.add_subparsers(title='Commands'), self.parent_parsers)
# We need to define a subparser for each command defined in the CallType class
for cmd in CallType:
subparsers.add_subparser(cmd.value)
@excp.exception(logger)
def parse_arguments(self) -> Dict:
"""Command parsing and selection"""
try: