[GRASS-dev] new option to set options to be required or exclusive, etc

Paulo van Breugel p.vanbreugel at gmail.com
Fri Jan 16 04:16:22 PST 2015


On Fri, Jan 16, 2015 at 12:54 PM, Markus Neteler <neteler at osgeo.org> wrote:

> On Fri, Jan 16, 2015 at 12:16 PM, Paulo van Breugel
> <p.vanbreugel at gmail.com> wrote:
> > I have three flags: i, d and c. When I use
> >
> > #%rules
> > #%required i,d,c
>               ^^^^^^^ -- I think the colon is missing
> > #%end
> >
>

Ah, yes, I did use the colon.. this was a copy/paste from an trial to see
if I could get it to work without colon. Both do not work for me/


> >
> > and then run the script, I get the message:
> >
> > Unknown option "i" in rule
> > Unknown option "d" in rule
> > Unknown option "c" in rule
> > ERROR: Internal error: option or flag not found
>
> The manual page of g.parser describes this (the online manual will
> show it in 20min from now:
>
> http://grass.osgeo.org/grass70/manuals/g.parser.html#conditional-parameters
>


I see what I missed: the flag needs to be given with a leading "*-*":

#%rules
# %required: -i,-d,-c
 #%end

It might be useful to have an example of both rules for options and for
flags (in the example section or perhaps even in the 'Conditional
parameter' section like below

For scripts, relationships are specified using a "rules" section, e.g.for
options:

	#%rules
	#%required: altitude,elevation
	#%end

and e.g., for flags:

        #%rules
	#%required: -f,-i
        #%end


p.s. note that in the help file the colon is still missing in the example
in the Conditional parameter section.


>
> Markus
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-dev/attachments/20150116/ace88697/attachment.html>


More information about the grass-dev mailing list