summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sphinx/cmdline.py14
1 files changed, 6 insertions, 8 deletions
diff --git a/sphinx/cmdline.py b/sphinx/cmdline.py
index 0662da14c..70828c635 100644
--- a/sphinx/cmdline.py
+++ b/sphinx/cmdline.py
@@ -164,12 +164,12 @@ def main(argv):
help='no output on stdout, just warnings on stderr')
group.add_option('-Q', action='store_true', dest='really_quiet',
help='no output at all, not even warnings')
- group.add_option('--color', type='choice', action='store', default='auto',
- choices=['yes', 'no', 'auto'],
- help='color terminal output (yes/no/auto)')
- group.add_option('-N', action='store_true', dest='nocolor',
- help='do not emit colored output (deprecated, '
- 'please use "--color=no")')
+ group.add_option('--color', dest='color',
+ action='store_const', const='yes', default='auto',
+ help='Do emit colored output (default: auto-detect)')
+ group.add_option('-N', '--no-color', dest='color',
+ action='store_const', const='no',
+ help='Do not emit colored output (default: auot-detect)')
group.add_option('-w', metavar='FILE', dest='warnfile',
help='write warnings (and errors) to given file')
group.add_option('-W', action='store_true', dest='warningiserror',
@@ -239,8 +239,6 @@ def main(argv):
print('Error: Cannot combine -a option and filenames.', file=sys.stderr)
return 1
- if opts.nocolor:
- opts.color = 'no'
if opts.color == 'no' or (opts.color == 'auto' and not color_terminal()):
nocolor()