<div dir="ltr"><br><br>On Wed, May 13, 2015 at 9:47 AM, Pietro <<a href="mailto:peter.zamb@gmail.com">peter.zamb@gmail.com</a>> wrote:<br>><br>> Hi Martin,<br>><br>> On Wed, May 13, 2015 at 11:08 AM, Martin Landa <<a href="mailto:landa.martin@gmail.com">landa.martin@gmail.com</a>> wrote:<br>> > Hi,<br>> ><br>> > 2015-05-13 8:03 GMT+02:00 Pietro <<a href="mailto:peter.zamb@gmail.com">peter.zamb@gmail.com</a>>:<br>> >> #% description: Name of vector map with interested segments of rivers<br>> ><br>> > <- label<br>><br>> Therefore I should use label instead of description, something like:<br>><br>> {{{<br>> #!/usr/bin/env python<br>> # -- coding: utf-8 --<br>> #%module<br>> #% description: Test<br>> #% keywords: test<br>> #%end<br>> #%option G_OPT_R_INPUT<br>> #% key: discharge<br>> #% label: Name of river discharge [m3/s]<br>> #% required: yes<br>> #%end<br>> #%option G_OPT_V_INPUT<br>> #% key: river<br>> #% label: Name of vector map with interested segments of rivers<br>> #% required: yes<br>> #%end<br>> from __future__ import print_function<br>> import sys<br>><br>> # import grass libraries<br>> from grass.script import core as gcore<br>><br>><br>> def main(opts, flgs):<br>>     print(opts, flgs)<br>><br>> if __name__ == "__main__":<br>>     options, flags = gcore.parser()<br>>     sys.exit(main(options, flags))<br>> }}}<br>><br>> The GUI is now fine and the command output looks:<br>><br>> {{{$ r.example --h<br>><br>> Description:<br>>  Test<br>><br>> Keywords:<br>>  test<br>><br>> Usage:<br>>  r.example discharge=name river=name [--help] [--verbose] [--quiet]<br>>    [--ui]<br>><br>> Flags:<br>>  --h   Print usage summary<br>>  --v   Verbose module output<br>>  --q   Quiet module output<br>>  --ui  Force launching GUI dialog<br>><br>> Parameters:<br>>   discharge   Name of river discharge [m3/s]<br>>                Name of input raster map<br>>       river   Name of vector map with interested segments of rivers<br>>                Or data source for direct OGR access<br>> }}}<br>><br>><br>> >> As you can see the description of the parameter add the default<br>> >> description set in G_OPT_V_INPUT and in a new line the description<br>> >> added manually in the definition of the module parameters. Instead the<br>> >> G_OPT_R_INPUT shows only the description set manually.<br>> ><br>> > right, G_OPT_V_INPUT has defined both label and description [1]. This<br>> > the source of inconsistency. There are more standard options which<br>> > defines both label and description.<br>><br>> Do you think this inconsistency should be fix, or just reported<br>> somewhere on a Wiki page?<br><br>Perhaps all standard options should define both label and description and you can then modify whatever suits you. (I often end up setting both.)<br><br>In the future, we should revise this anyway, like move from description to label as the primary one or making both mandatory.<br><br>> All the best.<br>><br>> Pietro<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">http://lists.osgeo.org/mailman/listinfo/grass-dev</a><br><br></div>