- action='store_true', dest='no_color', default=False,
- help='Do not emit color codes in output (Alias: --no-colours)')
+ action='store_const', dest='color', const={
+ 'stdout': 'no_color',
+ 'stderr': 'no_color',
+ },
+ help=optparse.SUPPRESS_HELP)
+ general.add_option(
+ '--color',
+ dest='color', metavar='[STREAM:]POLICY', default={}, type='str',
+ action='callback', callback=_dict_from_options_callback,
+ callback_kwargs={
+ 'allowed_keys': 'stdout|stderr',
+ 'default_key': ['stdout', 'stderr'],
+ 'process': str.strip,
+ }, help=(
+ 'Whether to emit color codes in output, optionally prefixed by '
+ 'the STREAM (stdout or stderr) to apply the setting to. '
+ 'Can be one of "always", "auto" (default), "never", or '
+ '"no_color" (use non color terminal sequences). '
+ 'Can be used multiple times'))