<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Sep 24, 2014 at 7:53 PM, Michael Barton <span dir="ltr"><<a href="mailto:Michael.Barton@asu.edu" target="_blank">Michael.Barton@asu.edu</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">



<div style="word-wrap:break-word">
I just learned that using upper case characters for a GRASS 7 module option means that g.parser will not recognize it. That is for module. “r.foo" with options “Abc” and “def”, the command
<div><br>
</div>
<div>r.foo Abc=1 def=2</div>
<div><br>
</div>
<div>will return an error <Abd=1> is not a valid option.</div>
<div><br>
</div>
<div>GRASS 6 does not produce an error in this case. The module will run fine. </div>
<div><br>
</div>
<div>This breaks all kinds of existing scripts from GRASS6, as well as scripts that are designed to be chained together. I’ve never seen any discussion of this. Perhaps I missed it because I was in the field or something. Is there a reason for this significant
 change of g.parser behavior? </div>
<div><br></div></div></blockquote><div><br></div><div>I think that the lowercase options are a good choice. There are some advantages of allowing uppercase like names of some coefficients (you can have phi but also Phi, k and K) and abbreviation (HTML, PDF). However, I think that the disadvantages are bigger. According to what I have seen, with possibility to have both options (upper and lower case), people would create options slope, but some other Slope, some perhaps even SLOPE. With two words in the option name, it would be even worse: elevation_model, ElevationModel, Elevation_model, Elevation_Model, ...<br><br>The consistency is not the only reason, we have there also Python and Bash scripts. In Python, the option names are function parameters which in the most Python coding styles should be lowercase (with or without underscores) which is exactly what GRASS 7 parser wants. For Bash the situation is different, we uppercase all the options (I believe in both 6 and 7) because they are part of variable names, so of course we can do this only if we know that all the letters have the same case, in 7 we know, they are lowercase.<br><br></div><div>I don't think that occasional need for uppercase letters outweighs the potential issues which would be potentially encountered by everyone.<br></div><div><br></div><div>Unfortunately, I'm not sure where is this documented and what was the reason when it was introduced, from the logs it seems that the behavior was introduced 6 year ago by Glynn:<br><br><a href="http://trac.osgeo.org/grass/changeset/32261">http://trac.osgeo.org/grass/changeset/32261</a><br><br></div><div>I don't see any other place where the relevant check is done, so I think it is this change. The check should be actually done when creating an option, not when the option has a value (now it look like as an user error rather then programmer's error).<br><br></div><div>Glynn, can you please comment on it?<br><br></div><div>Vaclav<br></div><div><br><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word"><div>
</div>
<div>Michael <br>
<div>
<div style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word">
<div style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word">
<div style="text-indent:0px;word-wrap:break-word">
<span style="border-collapse:separate;text-indent:0px;border-spacing:0px">
<div style="word-wrap:break-word">
<span style="border-collapse:separate;text-indent:0px;border-spacing:0px">
<div style="word-wrap:break-word">
<span style="border-collapse:separate;text-indent:0px;border-spacing:0px">
<div style="word-wrap:break-word">
<span style="border-collapse:separate;text-indent:0px;border-spacing:0px">
<div style="word-wrap:break-word">
<span style="border-collapse:separate;text-indent:0px;border-spacing:0px">
<div style="word-wrap:break-word">
<span style="border-collapse:separate;text-indent:0px;border-spacing:0px">
<div style="word-wrap:break-word">
<span style="border-collapse:separate;text-indent:0px;border-spacing:0px">
<div style="word-wrap:break-word">
<span style="border-collapse:separate;text-indent:0px;border-spacing:0px">
<div style="word-wrap:break-word">
<div>
<div style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-transform:none;white-space:normal;word-spacing:0px">
____________________</div>
<div style="font-variant:normal;letter-spacing:normal;line-height:normal;text-transform:none;white-space:normal;word-spacing:0px">
<font size="3" face="Helvetica">C. Michael Barton</font></div>
<div style="font-variant:normal;letter-spacing:normal;line-height:normal;text-transform:none;white-space:normal;word-spacing:0px">
<font size="3" face="Helvetica">Director, Center for Social Dynamics & Complexity </font></div>
<div style="font-variant:normal;letter-spacing:normal;line-height:normal;text-transform:none;white-space:normal;word-spacing:0px">
<font size="3" face="Helvetica">Professor of Anthropology, School of Human Evolution & Social Change</font></div>
<div><font size="3" face="Helvetica">Head, Graduate Faculty in Complex Adaptive Systems Science</font></div>
<div style="font-variant:normal;letter-spacing:normal;line-height:normal;text-transform:none;white-space:normal;word-spacing:0px">
<font size="3" face="Helvetica">Arizona State University</font></div>
<div style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-transform:none;white-space:normal;word-spacing:0px">
<br>
</div>
<font size="3" face="Helvetica"><font>voice:  </font><font><a href="tel:480-965-6262" value="+14809656262" target="_blank">480-965-6262</a> (SHESC), <a href="tel:480-965-8130" value="+14809658130" target="_blank">480-965-8130</a>/727-9746 (CSDC)</font><br>
<font>fax: <a href="tel:480-965-7671" value="+14809657671" target="_blank">480-965-7671</a> (SHESC),  <a href="tel:480-727-0709" value="+14807270709" target="_blank">480-727-0709</a> (CSDC)</font><br>
</font>
<div style="font-variant:normal;letter-spacing:normal;line-height:normal;text-transform:none;white-space:normal;word-spacing:0px">
<font size="3" face="Helvetica">www: <a href="http://www.public.asu.edu/~cmbarton" target="_blank">
http://www.public.asu.edu/~cmbarton</a>, <a href="http://csdc.asu.edu" target="_blank">http://csdc.asu.edu</a></font></div>
<br>
</div>
<br>
</div>
</span><br>
</div>
</span><br>
</div>
</span><br>
</div>
</span><br>
</div>
</span><br>
</div>
</span><br>
</div>
</span><br>
</div>
</span><br>
</div>
<br>
</div>
<br>
</div>
<br>
<br>
</div>
<br>
</div>
</div>

<br>_______________________________________________<br>
grass-dev mailing list<br>
<a href="mailto:grass-dev@lists.osgeo.org">grass-dev@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/grass-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/grass-dev</a><br></blockquote></div><br></div></div>