<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Aug 1, 2018 at 5:54 AM, Nikos Alexandris <span dir="ltr"><<a href="mailto:nik@nikosalexandris.net" target="_blank">nik@nikosalexandris.net</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">Ciao Vero,<br>
<br>
I had a look. I am not yet that familiar with the "UI" construction from<br>
C source code, so I am not sure where to dig for this (comment: with<br>
Python it's easy).<br>
<br>
As noted, and as you likely have observed,<br>
the 'html' manual mentions all options. They are only missing in<br>
the command line help text.<br>
<br>
The same is valid for `r.univar`, `r.stats.quantile` for<br>
example. That is: only one separator option is mentioned, the default<br>
one. All manuals do mention all options though.<br></blockquote><div><br></div><div>Hi Nikos,<br></div><div><br></div><div>The difference is between `options` and `descrtiption` items (let's call these items for now, basically key-value pairs defined in the code). The separators are defined in plain text as a `description` item while the options you see with other modules are defined using the structured `options` item. Note the difference in the manual "options:"/"Options:" and "Special characters:".</div><div><br></div><div>The reason why they are defined this ways is that `options` are the only allowed values checked by the command line parameters parser while `description` is simply a text for the user to read. For example, executing<br></div><div><br></div><div>r.colors map=elevation color=xxx</div><div><br></div><div>gives</div><div><br></div><div>ERROR: Value <xxx> out of range for parameter <color><br>    Legal range: aspect,aspectcolr,bcyr,bgyr,blues,...<br></div><div><br></div><div>On the other hand,<br></div><div><br></div><div>r.stats input=elevation -x sep=xxx<br></div><div><br></div><div>gives</div><div><br></div><div>1xxx1xxx141.99614<br>2xxx1xxx141.27849<br>3xxx1xxx141.37904<br>4xxx1xxx142.29822</div><div>...<br></div><div><br></div>Now, the reason why you don't see it in the command line help is that the separator parameter (which is a standard option G_OPT_F_SEP) defines both label and description:<br></div><div class="gmail_quote"><br></div><div class="gmail_quote"><a href="https://trac.osgeo.org/grass/browser/grass/trunk/lib/gis/parser_standard_options.c#L601">https://trac.osgeo.org/grass/browser/grass/trunk/lib/gis/parser_standard_options.c#L601</a><br></div><div class="gmail_quote"><a href="https://grass.osgeo.org/programming7/parser__standard__options_8c_source.html">https://grass.osgeo.org/programming7/parser__standard__options_8c_source.html</a></div><br>601    case G_OPT_F_SEP:<br>602        Opt->key = "separator";<br>603        Opt->type = TYPE_STRING;<br>604        Opt->key_desc = "character";<br>605        Opt->required = NO;<br>606        Opt->gisprompt = "old,separator,separator";<br>607        Opt->answer = "pipe";<br>608        Opt->label = _("Field separator");<br>609        Opt->description = _("Special characters: pipe, comma, space, tab, newline");<br>610        break;<div class="gmail_quote"><br></div><div class="gmail_quote">If both are defined, only label is shown in the command line help. That is to make the command line help short (so you can read it quickly without scrolling). The `default` and `options` items are part of the short help because they are considered crucial in getting the command line right. You can read about the decision here:<br></div><div class="gmail_quote"><br>[GRASS-dev] Adding an expert mode to the parser (September 2016)<br><div><br></div><div><a href="https://lists.osgeo.org/pipermail/grass-dev/2016-September/082388.html">https://lists.osgeo.org/pipermail/grass-dev/2016-September/082388.html</a></div><div><a href="https://lists.osgeo.org/pipermail/grass-dev/2016-September/082469.html">https://lists.osgeo.org/pipermail/grass-dev/2016-September/082469.html</a><br></div><div><a href="https://lists.osgeo.org/pipermail/grass-dev/2016-September/082526.html">https://lists.osgeo.org/pipermail/grass-dev/2016-September/082526.html</a><br></div><div> </div><div>That being said, this is not set in stone. For example, some modules could benefit from something like formalized "suggested values" as opposed to "the only allowed values", but "suggested values" is still not the same as "special characters" here or generally "specially treated values".<br></div><div><br></div><div>Best,</div><div>Vaclav<br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
I'll have to look at this later on.<br>
<br>
Thank you, Nikos<br>
<br>
* Veronica Andreo <<a href="mailto:veroandreo@gmail.com" target="_blank">veroandreo@gmail.com</a>> [2018-07-31 00:13:59 +0200]:<div class="gmail-HOEnZb"><div class="gmail-h5"><br>
<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
How is it described in all other modules using the "separator" option?<br>
Maybe, it is worth checking and making it uniform.<br>
You could open a ticket and provide a diff file ;)<br>
<br>
cheers,<br>
Vero<br>
<br>
El dom., 29 jul. 2018 a las 11:46, Nikos Alexandris (<<br>
<a href="mailto:nik@nikosalexandris.net" target="_blank">nik@nikosalexandris.net</a>>) escribió:<br>
<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
One observation: `r.stats`'s `--help` returns<br>
<br>
```<br>
Parameters:<br>
..<br>
   separator   Field separator<br>
               default: space<br>
..<br>
```<br>
<br>
Shouldn't all separator options be listed here?<br>
<br>
They are described in the `.html ` page:<br>
<br>
```<br>
..<br>
separator=character<br>
    Field separator<br>
    Special characters: pipe, comma, space, tab, newline<br>
    Default: space<br>
..<br>
```<br>
<br>
Does this deserve a ticker?<br>
<br>
Nikos<br>
______________________________<wbr>_________________<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="https://lists.osgeo.org/mailman/listinfo/grass-dev" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailma<wbr>n/listinfo/grass-dev</a><br>
</blockquote></blockquote>
<br></div></div><span class="gmail-HOEnZb"><font color="#888888">
-- <br>
Nikos Alexandris | Remote Sensing & Geomatics<br>
GPG Key Fingerprint 6F9D4506F3CA28380974D31A905353<wbr>4B693C4FB3 </font></span><br>______________________________<wbr>_________________<br>
grass-dev mailing list<br>
<a href="mailto:grass-dev@lists.osgeo.org">grass-dev@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/grass-dev" rel="noreferrer" target="_blank">https://lists.osgeo.org/<wbr>mailman/listinfo/grass-dev</a><br></blockquote></div><br></div></div>