@sh.add_function(
dsp, inputs_kwargs=True, inputs_defaults=True, outputs=_cmd_flags
)
def parse_cmd_flags(cmd_flags=None):
"""
Parses the command line options.
:param cmd_flags:
Command line options.
:type cmd_flags: dict
:return:
Default parameters of process model.
:rtype: tuple
"""
flags = sh.combine_dicts(cmd_flags or {}, base={
'only_summary': False,
'hard_validation': False,
'declaration_mode': False,
'enable_selector': False,
'type_approval_mode': False,
'encryption_keys': None,
'sign_key': None,
'output_template': sh.NONE,
'encryption_keys_passwords': None,
'output_folder': './outputs',
'augmented_summary': False
})
flags['declaration_mode'] |= flags['type_approval_mode']
flags['hard_validation'] |= flags['declaration_mode']
if flags['declaration_mode'] and not flags['type_approval_mode'] and \
flags['enable_selector']:
log.info(
'Since CO2MPAS is launched in declaration mode the option '
'--enable-selector is not used.\n'
'If you want to use it remove -DM from the cmd.'
)
flags['enable_selector'] = False
return sh.selector(_cmd_flags, flags, output_type='list')