Skip to content

Add colours to argparse interpolated values in --help #141939

@alexprengere

Description

@alexprengere

Feature or enhancement

Proposal:

#141680 was merged, but only applies when argparse.ArgumentDefaultsHelpFormatter is used.
I suggest to apply a similar change for all interpolated values, like when the help text leverages %(default)s to show default value(s):

Image

Excluding tests, the change is fairly simple, it is a 4 line change in argparse _expand_help method.

I am not sure if this should apply to just default or other interpolated values like choices.

Has this already been discussed elsewhere?

This is a minor feature, which does not need previous discussion elsewhere

Links to previous discussion of this feature:

No response

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancement

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions