@@ -74,7 +74,7 @@ ArgumentParser objects
7474 prefix_chars='-', fromfile_prefix_chars=None, \
7575 argument_default=None, conflict_handler='error', \
7676 add_help=True, allow_abbrev=True, exit_on_error=True, \
77- *, suggest_on_error=False, color=False )
77+ *, suggest_on_error=False, color=True )
7878
7979 Create a new :class: `ArgumentParser ` object. All parameters should be passed
8080 as keyword arguments. Each parameter has its own more detailed description
@@ -119,7 +119,7 @@ ArgumentParser objects
119119 * suggest_on_error _ - Enables suggestions for mistyped argument choices
120120 and subparser names (default: ``False ``)
121121
122- * color _ - Allow color output (default: ``False ``)
122+ * color _ - Allow color output (default: ``True ``)
123123
124124 .. versionchanged :: 3.5
125125 *allow_abbrev * parameter was added.
@@ -620,27 +620,19 @@ keyword argument::
620620color
621621^^^^^
622622
623- By default, the help message is printed in plain text . If you want to allow
624- color in help messages, you can enable it by setting ``color `` to ``True ``::
623+ By default, the help message is printed in color . If you want to plain text
624+ help messages, you can disable it by setting ``color `` to ``False ``::
625625
626626 >>> parser = argparse.ArgumentParser(description='Process some integers.',
627- ... color=True )
627+ ... color=False )
628628 >>> parser.add_argument('--action', choices=['sum', 'max'])
629629 >>> parser.add_argument('integers', metavar='N', type=int, nargs='+',
630630 ... help='an integer for the accumulator')
631631 >>> parser.parse_args(['--help'])
632632
633- Even if a CLI author has enabled color, it can be
633+ Even if a CLI author has not disabled color, it can be
634634:ref: `controlled using environment variables <using-on-controlling-color >`.
635635
636- If you're writing code that needs to be compatible with older Python versions
637- and want to opportunistically use ``color `` when it's available, you
638- can set it as an attribute after initializing the parser instead of using the
639- keyword argument::
640-
641- >>> parser = argparse.ArgumentParser(description='Process some integers.')
642- >>> parser.color = True
643-
644636.. versionadded :: 3.14
645637
646638
0 commit comments