New submission from ThatXliner <bryan.hu.2...@gmail.com>:

In argparse, I've always wanted a way to make colored help text like those of 
poetry and pipenv. But argparse's show help isn't well documented (Therefore, I 
can't find a way to completely modify the help text), and the metavar arg isn't 
really helpful. I want to do something like this:

>>> import argparse
>>> parser = argparse.ArgumentParser()
>>> parser.add_argument("foo", help="To foo a bar", display="FOO!!!!")
>>> parser.print_help()

usage: main.py [-h] foo

positional arguments:
  FOO!!!!     To foo a bar

optional arguments:
  -h, --help  show this help message and exit

>>>

That way, I can colorize the help output.

----------
components: Library (Lib)
messages: 378526
nosy: ThatXliner
priority: normal
severity: normal
status: open
title: Argparse: Add a "display" arg
type: enhancement
versions: Python 3.10, Python 3.9

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue42023>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to