<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jan 16, 2015 at 12:54 PM, Markus Neteler <span dir="ltr"><<a href="mailto:neteler@osgeo.org" target="_blank">neteler@osgeo.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="">On Fri, Jan 16, 2015 at 12:16 PM, Paulo van Breugel<br>
<<a href="mailto:p.vanbreugel@gmail.com">p.vanbreugel@gmail.com</a>> wrote:<br>
> I have three flags: i, d and c. When I use<br>
><br>
> #%rules<br>
> #%required i,d,c<br>
</span>              ^^^^^^^ -- I think the colon is missing<br>
<span class="">> #%end<br>
><br></span></blockquote><div><br></div><div>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/<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="">
><br>
> and then run the script, I get the message:<br>
><br>
> Unknown option "i" in rule<br>
> Unknown option "d" in rule<br>
> Unknown option "c" in rule<br>
> ERROR: Internal error: option or flag not found<br>
<br>
</span>The manual page of g.parser describes this (the online manual will<br>
show it in 20min from now:<br>
<br>
<a href="http://grass.osgeo.org/grass70/manuals/g.parser.html#conditional-parameters" target="_blank">http://grass.osgeo.org/grass70/manuals/g.parser.html#conditional-parameters</a><br></blockquote><div><br></div><div><br>I see what I missed: the flag needs to be given with a leading "<b>-</b>":<br><br><span class="">#%rules<br># %required: -i,-d,-c<br>
</span>
<span class="">#%end</span><br><br></div><div>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<br><br><p>
For scripts, relationships are specified using a "rules" section, e.g.for options:<br></p><div class=""><pre>       #%rules
        #%required: altitude,elevation
        #%end
</pre></div>and e.g., for flags:<br></div><div><br><pre>        #%rules
        #%required: -f,-i<br>        #%end</pre></div><div><br>p.s. note that in the help file the colon is still missing in the example in the Conditional parameter section.<br><h2></h2></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<span class=""><font color="#888888"><br>
Markus<br>
</font></span></blockquote></div><br></div></div>