Restrict colored_output value to always/never/auto.

This commit is contained in:
Dennis Camera 2020-06-06 13:39:29 +02:00
commit 23e66e08fa
5 changed files with 17 additions and 17 deletions

View file

@ -128,10 +128,9 @@ def get_parsers():
parser['colored_output'] = argparse.ArgumentParser(add_help=False)
parser['colored_output'].add_argument(
'--colors',
help='Use a colored output for different log levels.'
'It can be a boolean or "auto" (default) which enables this '
'feature if stdout is a tty and disables it otherwise.',
'--colors', metavar='WHEN',
help="Colorize cdist's output based on log level; "
"WHEN is 'always', 'never', or 'auto'.",
action='store', dest='colored_output', required=False,
choices=cdist.configuration.ColoredOutputOption.CHOICES)