ANNOUNCE: Optik 1.0 (new command-line parsing library)

Greg Ward gward at python.net
Wed Nov 14 08:48:43 EST 2001


[me, on allowing interspersed options and args in Optik]
> Not yet; I deliberately punted on this because most other Unix
> command-line parsing libraries are lazy and don't bother to scan all
> arguments for options.  (I think scanning all arguments is the preferred
> behaviour, but for historical reasons it should probably be optional
> behaviour.  I could be wrong...)

On 12 November 2001, Gustavo Niemeyer said:
> This seems desirable. It's usual for people (at least I have seen many
> doing this, including myself) to type a whole line, and then remember about
> a command line option and include it at the end.

OK, I think I'll add this feature.  Still haven't decided to enable it
by default, but I'm leaning that way right now -- it improves usability
and shouldn't ruin anyone's day, especially since "--" can always be
used for "stop processing options now".

I'll also see about adding "store_many" as a standard action.  Sounds
like it would be useful.  Those two features should be enough to justify
Optik 1.1.

> Btw, congratulations. I haven't used the library so far, but seems very
> flexible, and a nice option to include in standard library.

Maybe someday!  It should certainly get some exercise out in the field,
first.  But I would love to have something better than getopt in the
standard library.

> Meanwhile,
> you could want to pack the library in a single file, to be easier to
> include in other projects. Anyway, this should be easy to achieve by
> someone wanting to do so.

Nah, that's for others to do.  I'm concerned with keeping the code clear
and maintainable for now.  If you want to
  cat lib/[a-z]*.py > optik.py
then be my guest.  It would only be 725 lines, counting comments and
docs.

Just keep the name and the copyright message intact, please!

        Greg
-- 
Greg Ward - programmer-at-large                         gward at python.net
http://starship.python.net/~gward/
If you can read this, thank a programmer.




More information about the Python-list mailing list