[Python-Dev] Re: RFC: Option Parsing Libraries

Ben Wolfson wolfson@uchicago.edu
Mon, 11 Feb 2002 17:31:49 -0600


I have an option-parsing module at
http://home.uchicago.edu/~wolfson/Python/arglist.py ; from reading
Optik's docs it isn't as featureful but it does answer the list given in 
http://mail.python.org/pipermail/python-dev/2002-February/019937.html.
I haven't used Optik, but my module seems simpler to use.  It supports
arbitrary callbacks, can be strongly typed (insofar as passing, eg the
int function as a callback will generate an error if the value isn't
int-able), recognizes the identity of short and long forms, and has a
reasonable range of actions--if an option has no argument, by default it
records if it appeared and how often; if it does, it can append multiple
occurences to a list or keep only the last.  Callbacks aren't as flexible
as Optik's (they are functions of one argument) but with nested scopes
that probably wouldn't be terribly problematic.

I'm currently in the process of re-writing arglist.py in my spare time
since the code is rather messy, so if it's seen as a contender I could
add features.

-- 
BTR    
BEN WOLFSON HAS RUINED ROCK MUSIC FOR A GENERATION
 -- Crgre Jvyyneq