[issue42023] Argparse: Add a "display" arg

2020-10-14 Thread ThatXliner
ThatXliner added the comment: In the end, I think python's argparse needs more built-in help formatters... Should I close this? -- ___ Python tracker ___

[issue42023] Argparse: Add a "display" arg

2020-10-14 Thread ThatXliner
ThatXliner added the comment: Editing the description, etc. seems like a good way to do this. But it seems "hacky". The other answer on StackOverflow implements a custom class which does nice things, but not what I want. -- ___ Python tracker

[issue42023] Argparse: Add a "display" arg

2020-10-14 Thread paul j3
paul j3 added the comment: Some StackOverFlow answers cusomizing this help method: https://stackoverflow.com/questions/23936145/python-argparse-help-message-disable-metavar-for-short-options https://stackoverflow.com/questions/18275023/dont-show-long-options-twice-in-print-help-from-argparse

[issue42023] Argparse: Add a "display" arg

2020-10-14 Thread ThatXliner
ThatXliner added the comment: > So if you can get by with just customizing _format_action_invocation, there's > no need for further action here. Then maybe we could just make a new function that takes 2 arguments: Name of another action class (or the action class itself), and a tuple of the

[issue42023] Argparse: Add a "display" arg

2020-10-14 Thread ThatXliner
ThatXliner added the comment: Should I rename this to "Argparse: finer control on help txt" -- ___ Python tracker ___ ___

[issue42023] Argparse: Add a "display" arg

2020-10-14 Thread paul j3
paul j3 added the comment: That method could be customized in a HelpFormatter subclass. There already are several subclasses (documented), and writing your own is allowed, if not actually encouraged. https://docs.python.org/3/library/argparse.html#formatter-class Adding an extra parameter

[issue42023] Argparse: Add a "display" arg

2020-10-14 Thread ThatXliner
ThatXliner added the comment: >However, I can imagine adding a variable that gives the user full control over >the action-invocation. In: argparse.HelpFormatter._format_action_invocation method. That's what I'm trying to change. If there was a public API/method for manipulating the

[issue42023] Argparse: Add a "display" arg

2020-10-13 Thread paul j3
paul j3 added the comment: I'm not following this request either, especially the colored part. However, I can imagine adding a variable that gives the user full control over the action-invocation. In: argparse.HelpFormatter._format_action_invocation method. Currently it accepts the

[issue42023] Argparse: Add a "display" arg

2020-10-13 Thread Raymond Hettinger
Raymond Hettinger added the comment: > and the metavar arg isn't really helpful. Is your issue with *metavar* that it changes the help() output in two places? -- ___ Python tracker

[issue42023] Argparse: Add a "display" arg

2020-10-12 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +paul.j3, rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue42023] Argparse: Add a "display" arg

2020-10-12 Thread ThatXliner
New submission from ThatXliner : 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