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 bethard
Recipients bethard, gruszczy
Date 2011-03-26.12:16:41
SpamBayes Score 1.9493658e-07
Marked as misclassified No
Message-id <1301141803.0.0.219835327189.issue11174@psf.upfronthosting.co.za>
In-reply-to
Content
Sorry about such a slow response on this. Thanks for the patch!

I think rather than adding an ArgumentParser constructor parameter though, we should add a new formatter class. The attached patch allows you to write:

   >>> parser = argparse.ArgumentParser(
   ...     prog='PROG',
   ...     formatter_class=argparse.MetavarTypeHelpFormatter)
   >>> parser.add_argument('--foo', type=int)
   >>> parser.add_argument('bar', type=float)
   >>> parser.print_help()
   usage: PROG [-h] [--foo int] float

   positional arguments:
     float

   optional arguments:
     -h, --help  show this help message and exit
     --foo int

What do you think?
History
Date User Action Args
2011-03-26 12:16:43bethardsetrecipients: + bethard, gruszczy
2011-03-26 12:16:42bethardsetmessageid: <1301141803.0.0.219835327189.issue11174@psf.upfronthosting.co.za>
2011-03-26 12:16:42bethardlinkissue11174 messages
2011-03-26 12:16:42bethardcreate