Re: philosophical question

"Eric O. Angell" <[email protected]> Sat, 14 Aug 2004 09:31:48 -0700
Newsgroups gmane.comp.python.optik.user
Message-ID <[email protected]>
On Sat, Aug 14, 2004 at 22:37:20 +1000, Robert Collins wrote:

> symlinking the name is a bad idea IMO. That said, I consider the option
> groups thing to be a bug - but there are two different ways to address
> it:
> 
> allow the option to be in multiple groups
> allow the option to be added twice, one group each time, and with
> potentially different syntax/type etc.
> 
> which fits your needs more ?

Putting the option in multiple groups is more appropriate in my case.  As I
said, I just turn off the conflict handler, add the option the second time,
then turn the conflict handler back on.  Since optparse accepts any option
from any group, it doesn't really matter which group it's technically in, and
this makes it display in the help message for both groups.  I should note that
I'm adding _the same_ option, not a new option with the same values.  I do a
group2.add_option(group_1.get_option('--option')).  I don't remember for sure,
bit I think it doesn't do what I want if I add a new option that looks the
same, I think I have to do it this way.

Anyway, my question isn't so much about how to make it work, as I've already
gotten the above hack functioning.  I'm wondering what is the intended purpose
of option groups.  Why do you consider them to be a bug?

-E
signature.asc (application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)

iD8DBQFBHj5zlpoLUcvlhScRAj/jAKCIZiWi+snx8Ne2oU2JKZrGjzYZSACeKqZ5
xsHyT/fkDu8YUxQhZFPP8Uo=
=wcaH
-----END PGP SIGNATURE-----