Re: groupdefault (Re: mutually exclusive group of options)
Lorenzo Bettini <[email protected]> Fri, 16 Nov 2007 21:09:34 +0100
| Newsgroups | gmane.comp.gnu.gengetopt.general |
|---|---|
| Message-ID | <[email protected]> |
Hi there I've commited into the CVS a primordial implementation of mutually exclusive groups, which I called "modes" (since it kind of represents the modes an application can be used). I'm not still sure this is the correct name, so, please, if you have suggestions, they're more than welcome :-) this feature is still not yet documented (I'll do that next); here's an example (test_modes_cmd.ggo) package "test_modes" version "1.0" section "some modes just for testing" option "no-mode" N "a generic option not beloging to any mode" optional option "no-mode2" - "another generic option not beloging to any mode" string opt ional defmode "my grp2" defmode "my mode" defmode "grp1" modedesc="any option of this mode is in contrast with any option of the other mode\nNotice that this description is quite long so it may spawn ma ny lines... fortunately gengetopt will wrap it for you :-)" modeoption "opta" a "string a" multiple mode="grp1" modeoption "optA" A "string A" string argoptional mode="grp1" modeoption "optAmul" M "string M" argoptional string mode="grp1" multiple modeoption "optb" b "string b" mode="grp1" modeoption "optc" - "string c" mode="my grp2" modeoption "optd" d "string d" mode="my grp2" modeoption "mopt" m "option of my mode" int optional mode="my mode" and here's an example of execution with errors, due to conflicts: ./test_modes -a foo -m10 -d bar ./test_modes: option --opta conflicts with option --optd ./test_modes: option --opta conflicts with option --mopt ./test_modes: option --optd conflicts with option --mopt what do you think? hope to hear from you soon cheers Lorenzo -- Lorenzo Bettini, PhD in Computer Science, DSI, Univ. di Firenze ICQ# lbetto, 16080134 (GNU/Linux User # 158233) HOME: http://www.lorenzobettini.it MUSIC: http://www.purplesucker.com http://www.myspace.com/supertrouperabba BLOGS: http://tronprog.blogspot.com http://longlivemusic.blogspot.com http://www.gnu.org/software/src-highlite http://www.gnu.org/software/gengetopt http://www.gnu.org/software/gengen http://doublecpp.sourceforge.net