INNER CODE UNIT · Python
__init__
grycap/scar · scar/parser/cli/__init__.py:170
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:
cmd_args = self.parser.parse_args()
if cmd_args.version:
print(f"SCAR {version.__version__}")