Uh oh!
There was an error while loading. Please reload this page.
gh-142389: Add support for backtick colorisation in argparse help text - #149375
Conversation
Documentation build overview
|
savannahostrowski
left a comment
There was a problem hiding this comment.
I think there's one edge case here that we haven't considered...and should before extending this to help text. Poking around on GitHub, flake8 uses double backticks to denote code in help text (I also found at least one instance of this in pytest as well but it's not as pervasive). So, right now, with these changes users would see something like this, where there are funky stray backticks and incorrect colouring:

I think if we apply the new regex, update the docs and add a test or two, that should have us covered.
Other than that, I think this looks good. My preference would be to land this feature and then land application of backticks in a separate PR though (i.e. we can leave libregrtest changes for another PR?)
Uh oh!
There was an error while loading. Please reload this page.
When you're done making the requested changes, leave the comment: |
Co-authored-by: Savannah Ostrowski <savannah@python.org>
This reverts commit d8f6526.
hugovk
commented
May 4, 2026
Updated docs, docstring and added tests. Removed the regrtest change, will be in a followup with other stdlib stuff. I have made the requested changes; please review again. |
Thanks for making the requested changes! @savannahostrowski: please review the changes made to this pull request. |
hugovk
commented
May 4, 2026
There's a separate issue for this somewhere, and maybe even a PR? |
hugovk
commented
May 4, 2026
Please see PR #149384. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
savannahostrowski
left a comment
There was a problem hiding this comment.
Sweeeeet!
Thank Hugo!
Uh oh!
There was an error while loading. Please reload this page.
alexprengere
commented
May 5, 2026
I think this is the one #142035. The more colors applied, the more visible this will be 😉 . |


#142390 added support for displaying text enclosed in backticks in colour for the help description and epilogue.
This PR adds it for individual help.
Also add backticks to
python -m test --help:Will add to other stdlib CLIs in a followup.