[issue7284] argparse - display version in usage by default

2011-03-27 Thread Steven Bethard
Steven Bethard steven.beth...@gmail.com added the comment: I'm moving this over to Issue 11695, which proposes support for a usage/help message template. -- resolution: - duplicate stage: - committed/rejected status: open - closed superseder: - Improve argparse usage/help

[issue7284] argparse - display version in usage by default

2011-03-26 Thread Steven Bethard
Steven Bethard steven.beth...@gmail.com added the comment: In argparse, you could so something like: version = 2.7 parser = argparse.ArgumentParser( description=My program XXX, version + version) parser.add_argument('-v', action='version', version=version) That would then produce: usage:

[issue7284] argparse - display version in usage by default

2011-03-26 Thread anatoly techtonik
anatoly techtonik techto...@gmail.com added the comment: On Sat, Mar 26, 2011 at 12:20 PM, Steven Bethard rep...@bugs.python.org wrote: I see though that vi puts the full name and version before the usage (which is currently impossible in argparse): That was exactly my use case, which I'd

[issue7284] argparse - display version in usage by default

2011-03-26 Thread anatoly techtonik
anatoly techtonik techto...@gmail.com added the comment: On Sat, Mar 26, 2011 at 12:20 PM, Steven Bethard rep...@bugs.python.org wrote: I guess we could add, say, a headline= option to ArgumentParser which would then be printed before the usage message if it's really crucial to have that

[issue7284] argparse - display version in usage by default

2011-03-26 Thread Steven Bethard
Steven Bethard steven.beth...@gmail.com added the comment: I'm not sure about the usage_template approach - seems like it might be hard to make it work, while still supporting formatter_class. (Though maybe it's not so bad since the formatter class methods are all considered implementation

[issue7284] argparse - display version in usage by default

2011-03-26 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: On Sat, Mar 26, 2011 at 9:14 PM, anatoly techtonik techto...@gmail.com wrote: A pity that before argparse replaced optparse, there was no research made to gather the output from various console tools to see how argparse really saves people

[issue7284] argparse - display version in usage by default

2011-03-26 Thread anatoly techtonik
anatoly techtonik techto...@gmail.com added the comment: On Sat, Mar 26, 2011 at 2:28 PM, Steven Bethard rep...@bugs.python.org wrote: I'm not sure about the usage_template approach - seems like it might be hard to make it work, while still supporting formatter_class. (Though maybe it's

[issue7284] argparse - display version in usage by default

2011-02-18 Thread Éric Araujo
Changes by Éric Araujo mer...@netwok.org: -- nosy: +bethard -aronacher resolution: wont fix - stage: committed/rejected - title: optparse - display version in usage by default - argparse - display version in usage by default ___ Python tracker