[issue11695] Improve argparse usage/help customization

2014-06-21 Thread paul j3
paul j3 added the comment: That original template can also be implemented with a customized 'format_help': def custom_help(self): formatter = self._get_formatter() formatter.add_text('My Program, version 3.5') formatter.add_usage(self.usage, self._actions,

[issue11695] Improve argparse usage/help customization

2014-06-20 Thread paul j3
paul j3 added the comment: This patch has a 'custom_help' which, with a default template, is compatible with 'format_help' (i.e. it passes test_argparse). It also handles the sample template in this issue. Due to long line wrapping issues, the 'Usage: ' string the test template has to be ent

[issue11695] Improve argparse usage/help customization

2014-06-19 Thread paul j3
paul j3 added the comment: Here's a function that implements the format string: def custom_help(template): def usage(self): formatter = self._get_formatter() formatter.add_usage(self.usage, self._actions, self._mutually_exclusive_groups, prefix

[issue11695] Improve argparse usage/help customization

2014-06-16 Thread Mark Lawrence
Changes by Mark Lawrence : -- nosy: +paul.j3 versions: +Python 2.7, Python 3.5 -Python 3.3 ___ Python tracker ___ ___ Python-bugs-list

[issue11695] Improve argparse usage/help customization

2013-01-09 Thread Chris Jerdonek
Chris Jerdonek added the comment: +1 to the feature. A closely-related use case is customizing the message displayed by error(), which is normally the usage string followed by the error message. I wanted to append instructions on how to invoke --help, and implemented it this way for CPython'

[issue11695] Improve argparse usage/help customization

2013-01-09 Thread John O'Connor
Changes by John O'Connor : -- nosy: +jcon ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.or

[issue11695] Improve argparse usage/help customization

2012-01-16 Thread Berker Peksag
Changes by Berker Peksag : -- nosy: +berkerpeksag ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.p

[issue11695] Improve argparse usage/help customization

2011-06-21 Thread Petri Lehtinen
Changes by Petri Lehtinen : -- nosy: +petri.lehtinen ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mai

[issue11695] Improve argparse usage/help customization

2011-03-27 Thread Steven Bethard
New submission from Steven Bethard : I'm going to try to merge several closely related issues here. Basically, people would like better control over the usage message formatting so that you could: * Put program name and version information at the top of the message * Customize the "usage:" str