Help on usage or feature request: default mode

View: New views
2 Messages — Rating Filter:   Alert me  

Help on usage or feature request: default mode

by Kay-Michael Wuerzner-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

mode options are a great extension to gengetopt. Many thanks for
integrating this feature.

1. Is there a possibilty to define a 'default mode'?
I tried the following specification (I skipped some options for
reasons of readability):

defmode "moot tagger"

modeoption      "ta-moot"       -       "Use moot tagger"
       flag    on      mode="moot tagger"

modeoption      "ta-moot-model"      -   "Language model for moot"
       string  typestr="FILE ()"       mode="moot tagger"      required

defmode "tree tagger"

modeoption      "ta-tree"       -       "Use tree tagger"
       flag    off     mode="tree tagger"

modeoption      "ta-tree-model"      -   "Language model for moot"
       string  typestr="FILE ()"       mode="tree tagger"      required

I would expect the program to give an error message (dummy:
'--ta-moot-model' option required), if run without any option. But no
errors are reported. Is there any workaround?

2. Is it possible to nest groups and modes? E.g. I would like to have
modes for some aspects of my program. I can implement flags using a
combination of the 'values' and the 'dependon' 'keyword. But I do not
see how more complex arguments like those above could depend on
previously set arguments.

Thanks in advance.

Best regards,
Kay


_______________________________________________
Help-gengetopt mailing list
Help-gengetopt@...
http://lists.gnu.org/mailman/listinfo/help-gengetopt

Re: Help on usage or feature request: default mode

by Lorenzo Bettini :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Kay-Michael Wuerzner wrote:
> Hi,
>
> mode options are a great extension to gengetopt. Many thanks for
> integrating this feature.

Hi there

happy you like the new features :-)

>
> 1. Is there a possibilty to define a 'default mode'?

actually I hadn't thought about that, but you're right: we need a
default mode, let me think about this feature

> I tried the following specification (I skipped some options for
> reasons of readability):
>
> defmode "moot tagger"
>
> modeoption      "ta-moot"       -       "Use moot tagger"
>        flag    on      mode="moot tagger"
>
> modeoption      "ta-moot-model"      -   "Language model for moot"
>        string  typestr="FILE ()"       mode="moot tagger"      required
>
> defmode "tree tagger"
>
> modeoption      "ta-tree"       -       "Use tree tagger"
>        flag    off     mode="tree tagger"
>
> modeoption      "ta-tree-model"      -   "Language model for moot"
>        string  typestr="FILE ()"       mode="tree tagger"      required
>
> I would expect the program to give an error message (dummy:
> '--ta-moot-model' option required), if run without any option. But no
> errors are reported. Is there any workaround?
>
> 2. Is it possible to nest groups and modes? E.g. I would like to have
> modes for some aspects of my program. I can implement flags using a
> combination of the 'values' and the 'dependon' 'keyword. But I do not
> see how more complex arguments like those above could depend on
> previously set arguments.

mh... shouldn't it be already like that?
Doesn't it work to nest group inside modes?

cheers
        Lorenzo

--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
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


_______________________________________________
Help-gengetopt mailing list
Help-gengetopt@...
http://lists.gnu.org/mailman/listinfo/help-gengetopt