Re: parsing partial options
Greg Ward <[email protected]> Sat, 13 Nov 2004 17:04:12 -0500
| Newsgroups | gmane.comp.python.optik.user |
|---|---|
| Message-ID | <[email protected]> |
On 13 November 2004, I said:
> I'll throw together a test program and see if I can't use it to correct
> some of these design errors.
OK, everything you need is in r469 in Optik's Subversion repository.
You can check it out here:
svn://starship.python.net/optik/trunk
In particular, take a look at examples/pass_through.py. So far I know
of one interesting subtlety -- if you run this:
./examples/pass_through.py -a foo -c -b foo --foo=bar
expecting "--foo=bar" to be passed through as one argument, it actually
comes out as two:
options: {'a': 'foo', 'b': 'foo', 'other': None, 'value': None}
args: ['-c', '--foo', 'bar']
The reason for this should be obvious from reading
OptionParser._process_long_opt(). I'm not going to expend much energy
fixing it right now, since I have a feeling all that will be changing
soon (to support variable arguments).
Greg
--
Greg Ward <[email protected]> http://www.gerg.ca/
Always look on the bright side of life.
-------------------------------------------------------
This SF.Net email is sponsored by: InterSystems CACHE
FREE OODBMS DOWNLOAD - A multidimensional database that combines
robust object and relational technologies, making it a perfect match
for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8