[Svnmerge] Long argument processing of OptBase

Giovanni Bajo rasky at develer.com
Tue Mar 28 00:50:31 PST 2006


Daniel Rall <dlr at collab.net> wrote:

> OptBase's constructor contains the following, undocumented code:
>
>            self.dest = self.lflags[0][2:].replace("-", "_")
>
> Why does it do this?

In a first iteration (never committed), the value of the options from the
command line were being put as attributes of an object (instead of being
keys of a dictionary), just like the standard Python optparse module does.
In that case, you'd end up with opts.record_only (instead of
opts["record-only"]).

It's a leftover. I don't think there's value in keeping such a replace()
right now, so you can throw it away. I can reinstate it if I ever want to
change from opts["name"] to opts.name.
-- 
Giovanni Bajo




More information about the Svnmerge mailing list