--no-color option introduced

This commit is contained in:
hroff-1902 2019-08-12 21:07:29 +03:00
parent 8f92912852
commit 1a34b9b61c
2 changed files with 8 additions and 6 deletions

View File

@ -192,10 +192,11 @@ AVAILABLE_CLI_OPTIONS = {
default=False,
),
"print_colorized": Arg(
'--color', '--print-colorized',
help='Print colorized hyperopt results.',
action='store_true',
default=False
'--no-color',
help='Disable colorization of hyperopt results. May be useful if you are '
'redirecting output to a file.',
action='store_false',
default=True,
),
"hyperopt_jobs": Arg(
'-j', '--job-workers',

View File

@ -254,8 +254,9 @@ class Configuration(object):
self._args_to_config(config, argname='print_all',
logstring='Parameter --print-all detected ...')
self._args_to_config(config, argname='print_colorized',
logstring='Parameter --color/--print-colorized detected ...')
if 'print_colorized' in self.args and not self.args.print_colorized:
logger.info('Parameter --no-color detected ...')
config.update({'print_colorized': getattr(self.args, 'print_colorized')})
self._args_to_config(config, argname='hyperopt_jobs',
logstring='Parameter -j/--job-workers detected: {}')