James <[EMAIL PROTECTED]> writes:

 > I would like to know your thoughts on a proposed change to optparse
 > that I have planned. It is possible to add default values to
 > multiple options using the set_defaults. However, when adding
 > descriptions to options the developer has to specify it in each
 > add_option() call.

-1

I see no advantage to swelling optparse when the language offers many
solutions already.  E.g.

desc = {
    'verbose': 'Output less information',
    'castordir': 'specify the wanted CASTOR directory where to store '
    'the results tarball',
    'previousrel': 'Top level dir of previous release for regression '
    'analysis'}

parser.add_option('-q', '--quiet', action="store_false",
                  dest='verbose', help = desc['verbose'])
...


Or another approach might be like this.

for ... in zip(...):
    parser.add_option(...)

-- 
Pete Forman                -./\.-  Disclaimer: This post is originated
WesternGeco                  -./\.-   by myself and does not represent
[EMAIL PROTECTED]    -./\.-   the opinion of Schlumberger or
http://petef.22web.net           -./\.-   WesternGeco.
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to