Problem with OptionParser

Florian Lindner Florian.Lindner at xgm.de
Thu Feb 26 16:06:55 CET 2004


Berthold Höllmann wrote:

> Florian Lindner <Florian.Lindner at xgm.de> writes:
> 
>> Hello,
>> I've this tiny Python sample:
>>
>> - - - -
>> #!/usr/bin/python
>>
>> from optparse import OptionParser, OptionValueError
>>
>> def option_callback(option, opt, value, parser, *args, **kwargs):
>>     pass
>>
>> optparser = OptionParser()
>> optparser.add_option("-t", "--type", action="callback",
>> callback=option_callback, type="string")
>> (options, arguments) = optparser.parse_args()
>> - - - -
> 
> As a workaround you could set "metavar", I posted a first fix to the
> Optik mailing list.
> 
> Regards
> 
> Berthold

To what value I should set metavar? What is this? I've nothing in the
docs...
Thx,
Florian



More information about the Python-list mailing list