[issue7284] argparse - display version in usage by default

2011-03-27 Thread Steven Bethard
Steven Bethard 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 customization

[issue7284] argparse - display version in usage by default

2011-03-26 Thread anatoly techtonik
anatoly techtonik added the comment: On Sat, Mar 26, 2011 at 2:28 PM, Steven Bethard 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 > not so bad since the formatter class met

[issue7284] argparse - display version in usage by default

2011-03-26 Thread Nick Coghlan
Nick Coghlan added the comment: On Sat, Mar 26, 2011 at 9:14 PM, anatoly techtonik 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 from reinventing their solutions. ar

[issue7284] argparse - display version in usage by default

2011-03-26 Thread Steven Bethard
Steven Bethard 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 details.) I'm open to patch

[issue7284] argparse - display version in usage by default

2011-03-26 Thread anatoly techtonik
anatoly techtonik added the comment: On Sat, Mar 26, 2011 at 12:20 PM, Steven Bethard 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 > message first... I'd rather not though i

[issue7284] argparse - display version in usage by default

2011-03-26 Thread anatoly techtonik
anatoly techtonik added the comment: On Sat, Mar 26, 2011 at 12:20 PM, Steven Bethard 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 say is very common for small utilities.

[issue7284] argparse - display version in usage by default

2011-03-26 Thread Steven Bethard
Steven Bethard 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: PROG [-h] [-v] My p

[issue7284] argparse - display version in usage by default

2011-02-18 Thread Éric Araujo
Changes by Éric Araujo : -- 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