<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Mar 11, 2014 at 6:48 PM, Vaclav Petras <span dir="ltr"><<a href="mailto:wenzeslaus@gmail.com" target="_blank">wenzeslaus@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div><br></div><div><br></div><div><br></div>

<div><br></div><div class="gmail_extra"><br><br><div class="gmail_quote"><div class="">On Tue, Mar 11, 2014 at 9:40 AM, Alessandro Samuel Rosa <span dir="ltr"><<a href="mailto:alessandrosamuel@yahoo.com.br" target="_blank">alessandrosamuel@yahoo.com.br</a>></span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><u></u>


  
  

<div>
Dear Grass Developers,<br>
<br>
I am using GRASS from R with package spgrass6. There is an inconsistency between some modules which I believe is not related with R or spgrass6. Usually, calling a module without passing any arguments is the same as using argument "-help". For example, system("r.carve") returns the same as system("r.carve -help"). This is not true for "r.colors". When calling "r.colors" without the help argument, GRASS returns an error message informing that no raster map was specified.</div>


</blockquote><div><br></div></div><div>I can confirm the inconsistency. I tested command line and ipython. In GRASS 7, r.colors returns 1 and prints error message. r.carve opens GUI, and g.region returns 0 and does nothing.</div>


<div><br></div><div>{{{</div><div><div><div>GRASS > r.colors</div><div>ERROR: Options <map> or <file> must be specified</div><div>GRASS > r.carve</div><div>(GUI opens)</div><div>GRASS > g.region</div>


</div><div>(nothing happens)</div><div>}}}</div><div><br></div></div></div></div></div></blockquote><div><br></div><div>Fourth type are the modules where no parameters are valid, e.g. g.gisenv:</div><div><br></div><div>{{{</div>

<div><div>g.gisenv </div><div>DEBUG=0</div><div>LOCATION_NAME=grass_fire_demolocation</div><div>GISDBASE=/home/vasek/Documents/mea582/project/grassdata</div><div>MAPSET=vasek</div><div>GUI=wxpython</div></div><div>}}}</div>

<div><br></div><div>The consistency is achieved in wxGUI Command line where every module without parameters causes the dialog to be open. This is nicely hides the inconsistency between r.color, r.carve, and g.region but unfortunately, it prevents g.gisenv from running. The workaround is to use the `-n` flag in this case.</div>

<div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">

<div><div></div><div>{{{</div><div><div>In [1]: import grass.script.core as gcore</div><div><br>In [2]: gcore.run_command('r.colors')</div><div>ERROR: Options <map> or <file> must be specified</div>
<div>Out[2]: 1</div><div><br></div><div>In [3]: gcore.run_command('r.carve')</div><div>(GUI opens)</div><div><br></div><div>In [4]: gcore.run_command('g.region')</div><div>Out[4]: 0</div></div></div><div class="">

<div>}}}</div>
<div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div>If I not wrong, there is another module that I used sometime ago which has the same behaviour, but I can not remember which.<br>


</div></blockquote><div><br></div></div><div>These can apply to modules which has mandatory argument but there are two to choose from such as `file` and `map` in case of r.colors.</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

<div class="">
<div>
<br>
I suggest that, if possible, the help of any module could be called simply passing the module name without further arguments.<br>
<br>
Regards,<span><font color="#888888"><br>
<br>
<br>
<table cellspacing="0" cellpadding="0" width="100%">
<tbody><tr>
<td>
-- <br>
<br>
Alessandro Samuel-Rosa<br>
---<br>
PhD Candidate Graduate School in Agronomy - Soil Science<br>
Federal Rural University of Rio de Janeiro<br>
SeropĂ©dica, Rio de Janeiro, Brazil<br>
---<br>
Guest Researcher ISRIC - World Soil Information<br>
Wageningen, the Netherlands <a href="mailto:alessandro.rosa@wur.nl" target="_blank">alessandro.rosa@wur.nl</a> | Phone 0031 06 4435 9563<br>
---<br>
Homepage: <a href="http://soil-scientist.net/" target="_blank">soil-scientist.net</a> Skype: alessandrosamuel <br>
<br>
<br>
</td>
</tr>
</tbody></table>
</font></span></div>

<br></div>_______________________________________________<br>
grass-dev mailing list<br>
<a href="mailto:grass-dev@lists.osgeo.org" target="_blank">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>
</blockquote></div><br></div></div>