argparse icon indicating copy to clipboard operation
argparse copied to clipboard

Add additional help formatters

Open shkuropat opened this issue 14 years ago • 3 comments

See http://docs.python.org/dev/library/argparse.html#formatter-class

shkuropat avatar May 15 '12 06:05 shkuropat

Looks like all formatters now exists, except MetavarTypeHelpFormatter

puzrin avatar Mar 14 '13 06:03 puzrin

I saw MetavarTypeHelpFormatter in the development python (3.4), but it's not in 2.7.3. It should be simple addition, redefining a couple of functions:

    def _get_default_metavar_for_optional(self, action):
        return action.type.__name__

    def _get_default_metavar_for_positional(self, action):
        return action.type.__name__

hpaulj avatar Mar 14 '13 08:03 hpaulj

Everything from python should be ported right now (in argparse 2.0), please open a new issue if it isn't.

rlidwka avatar Aug 14 '20 14:08 rlidwka