philosophical question

"Eric O. Angell" <[email protected]> Fri, 13 Aug 2004 09:31:02 -0700
Newsgroups gmane.comp.python.optik.user
Message-ID <[email protected]>
I've read through most of the optparse documentation a couple of times (I've
mostly skipped the callbacks section since I'm not using any, but I've read
the rest), and I have a question about intent that isn't addressed anywhere I
can see.

What is the intended purpose of option groups?  I'm writing a script that has
several different possible actions, each of which are affected by a mostly
disjoint set of options.  It seemed to make sense to me to separate the
options for each action by putting them in different option groups so that the
help message prints in a reasonable manner, which works almost beautifully.
The problem I ran into was that the different option sets are *almost*
disjoint.  I have one option that applies to two different actions, so I want
it to appear in the help message of each group.  I'm currently working around
this by turning off the conflict handler when I add it the second time, but
the need to do that makes it pretty clear that my idea is outside the
philosophy.  Since there's no clear explanation of the purpose of option
groups in the documentation (the "Dangerous Options" example is a start, but I
was hoping for something more), I was hoping to get some insight from the
list.

You're probably going to tell me that my script is behaving too much like tar
in requiring a command as an argument, huh?  I've toyed with the idea of
either writing it as several different scripts or letting it be called by one
of several different names, but that just seems like it would increase
maintenence difficulty.  The latter option isn't really feasible anyway, since
Windows and CVS both handle symlinks poorly.

Thanks.

-E


-------------------------------------------------------
SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media
100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33
Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285