This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author pde
Recipients pde
Date 2016-11-19.00:17:08
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1479514629.23.0.218870455687.issue28742@psf.upfronthosting.co.za>
In-reply-to
Content
When argparse lists the default values for cli flags and arguments, it shows argparse's view of the internal Pythonic default, not the default behaviour of the program as a whole. This can be wrong in many cases, as documented at https://bugs.python.org/issue27153 and https://github.com/certbot/certbot/issues/3734.

To mitigate this, we should allow the caller to set arbitrary strings that argparse will display to the user as the "default" in the CLI help.

I wrote a first patch to do this via a new "help_default" argument that can be added to argparse actions:

https://gist.github.com/pde/daec08cadc21bca0d62852020887ee13

The patch was written against argparse.py from Python2.7, but seems to apply and run okay against the Python 3.x version.
History
Date User Action Args
2016-11-19 00:17:09pdesetrecipients: + pde
2016-11-19 00:17:09pdesetmessageid: <1479514629.23.0.218870455687.issue28742@psf.upfronthosting.co.za>
2016-11-19 00:17:09pdelinkissue28742 messages
2016-11-19 00:17:08pdecreate