On Fri, Jan 16, 2015 at 12:54 PM, Markus Neteler <neteler@osgeo.org> wrote:
On Fri, Jan 16, 2015 at 12:16 PM, Paulo van Breugel
<p.vanbreugel@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