You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The defaults are also in the same plaintext as the main help, but some other CLIs use another colour.
Typer defaults are light grey:
Composer defaults are yellow:
For argparse, I suggest having "(default: " and ")" in grey, as they're not so important (and always the same). And the default value itself in (non-bold) yellow, to mirror the (bold) yellow of the label, where the default is sort of slotting into. For example, "pretty" is the default format, and the other choices are also in yellow:
Has this already been discussed elsewhere?
This is a minor feature, which does not need previous discussion elsewhere
Would not using too much colors distract and make it hard to read?
Some programs that use argparse include "(default: ...)" with literal description in the argument help. Some programs use %(default)s in the argument help. Now they will be different from the generated ones.
As someone who use %(default)s a lot to describe options, I would be glad to have similar colors applied when interpolating such variables. I can open another issue to that effect, and probably work on a PR, if this seems like a good idea.
Activity
serhiy-storchaka commentedon Nov 18, 2025
Would not using too much colors distract and make it hard to read?
Some programs that use
argparseinclude "(default: ...)" with literal description in the argument help. Some programs use%(default)sin the argument help. Now they will be different from the generated ones.gh-141679: Add colour to defaults in `argparse` help (#141680)
alexprengere commentedon Nov 23, 2025
I think this is a great addition!
As someone who use
%(default)sa lot to describe options, I would be glad to have similar colors applied when interpolating such variables. I can open another issue to that effect, and probably work on a PR, if this seems like a good idea.pythongh-141679: Add colour to defaults in `argparse` help (python#14…
pythongh-141679: Add colour to defaults in `argparse` help (python#14…