[issue9653] New default argparse output to be added

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

[issue9653] New default argparse output to be added

2010-08-24 Thread Steven Bethard
Steven Bethard steven.beth...@gmail.com added the comment: I see. When there are no arguments you basically want to replace the standard argparse help entirely with your own message, with your own capitalization, etc. What you're doing now looks like a pretty good approach for this, so I

[issue9653] New default argparse output to be added

2010-08-24 Thread Tom Browder
Tom Browder tom.brow...@gmail.com added the comment: ... I see. When there are no arguments you basically want to replace the standard argparse help entirely with your own message, with your own capitalization, etc. What you're doing now looks like a pretty good approach for this, so I

[issue9653] New default argparse output to be added

2010-08-23 Thread Tom Browder
Tom Browder tom.brow...@gmail.com added the comment: On Sun, Aug 22, 2010 at 17:06, Steven Bethard rep...@bugs.python.org wrote: ... import argparse import sys parser = argparse.ArgumentParser() parser.add_argument('--foo') if len(sys.argv) == 1:    parser.print_help() else:    

[issue9653] New default argparse output to be added

2010-08-22 Thread Tom Browder
Tom Browder tom.brow...@gmail.com added the comment: On Sun, Aug 22, 2010 at 16:01, Steven Bethard rep...@bugs.python.org wrote: Steven Bethard steven.beth...@gmail.com added the comment: A simpler approach might be to do this before your call to parse_args: if len(sys.argv[0]) == 1:    

[issue9653] New default argparse output to be added

2010-08-22 Thread Steven Bethard
Steven Bethard steven.beth...@gmail.com added the comment: A simpler approach might be to do this before your call to parse_args: if len(sys.argv[0]) == 1: parser.print_help() Does that solve your problem? -- ___ Python tracker

[issue9653] New default argparse output to be added

2010-08-22 Thread Steven Bethard
Steven Bethard steven.beth...@gmail.com added the comment: Sorry, typo. Should have been len(sys.argv) == 1. Full script: import argparse import sys parser = argparse.ArgumentParser() parser.add_argument('--foo') if len(sys.argv) == 1: parser.print_help() else:

[issue9653] New default argparse output to be added

2010-08-20 Thread Tom Browder
New submission from Tom Browder tom.brow...@gmail.com: When I use the argparse module, and I enter my program name with NO arguments or options, I would like the argparser to output something like: Usage: program name [options] Use option '-h' for help. I haven't yet found how to do that in

[issue9653] New default argparse output to be added

2010-08-20 Thread Benjamin Peterson
Changes by Benjamin Peterson benja...@python.org: -- assignee: - bethard nosy: +bethard ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9653 ___