make 'callback' an optparse typed action

* this ensures metavars are shown with print_help
This commit is contained in:
Pedro Silva 2013-11-16 19:58:49 +01:00
parent e8d6c94995
commit d00859e330

View file

@ -695,6 +695,7 @@ class SubcommandsOptionParser(optparse.OptionParser):
return options, subcommand, suboptions, subargs
optparse.Option.ALWAYS_TYPED_ACTIONS += ('callback',)
def vararg_callback(option, opt_str, value, parser):
"""Callback for an option with variable arguments.
Manually collect arguments right of a callback-action