[GRASS-dev] where are the options listed for g.parser?

The g.parser manual only gives a very limited set of examples for the options available to g.parser for creating a script GUI. Are these listed somewhere yet or are they still secret arcane knowledge?

Michael


C. Michael Barton
Director, Center for Social Dynamics & Complexity
Professor of Anthropology, School of Human Evolution & Social Change
Arizona State University

voice: 480-965-6262 (SHESC), 480-965-8130/727-9746 (CSDC)
fax: 480-965-7671 (SHESC), 480-727-0709 (CSDC)

www: http://www.public.asu.edu/~cmbarton, http://csdc.asu.edu

Hello Michael,
recently there was a request about GUI prompting with hints to documentation:
http://lists.osgeo.org/pipermail/grass-dev/2013-November/066267.html
Right next to the gisprompt is also a pointer to standard options:
http://grass.osgeo.org/programming7/parser__standard__options_8c.html

If it is not what you are looking for, please clarify, and we all will
help you to find necessary information.

Cheers,
Maris.

2013/11/18 Michael Barton <Michael.Barton@asu.edu>:

The g.parser manual only gives a very limited set of examples for the
options available to g.parser for creating a script GUI. Are these listed
somewhere yet or are they still secret arcane knowledge?

Michael
____________________
C. Michael Barton
Director, Center for Social Dynamics & Complexity
Professor of Anthropology, School of Human Evolution & Social Change
Arizona State University

voice: 480-965-6262 (SHESC), 480-965-8130/727-9746 (CSDC)
fax: 480-965-7671 (SHESC), 480-727-0709 (CSDC)
www: http://www.public.asu.edu/~cmbarton, http://csdc.asu.edu

_______________________________________________
grass-dev mailing list
grass-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev

Michael Barton wrote:

The g.parser manual only gives a very limited set of examples for the
options available to g.parser for creating a script GUI.

I agree.

Are these listed somewhere yet or are they still secret arcane knowledge?

As a "noob", I had to go through other existing scripts to see how to
structure a custom script.

Nikos

On Mon, Nov 18, 2013 at 10:15 AM, Maris Nartiss <maris.gis@gmail.com> wrote:

Hello Michael,
recently there was a request about GUI prompting with hints to documentation:
http://lists.osgeo.org/pipermail/grass-dev/2013-November/066267.html
Right next to the gisprompt is also a pointer to standard options:
http://grass.osgeo.org/programming7/parser__standard__options_8c.html

I have added the progman link to
http://grasswiki.osgeo.org/wiki/Module_command_line_parser

Markus

Thanks much Markus. This is a start. This is aimed at C programming, however, and only some of the keys and values transfer over to scripts. Following your link, I found additional info at: GRASS GIS 7 Programmer's Manual: gis.h Source File

But again, this is aimed at creating interfaces in C. There is overlap, of course, but it is not the same.

What we need is something comprehensive along the lines of the example below. I don't know where it should live, but we've needed it for a long time. There should be a link to it in the g.parser docs, since the example given there is very simple. After quite a few years of scripting in GRASS I still don't know what all the options are or the possible values for some of the option fields.

Michael

-----

INTRO

begin with #%Module
end with #%End

The following are required
#% description:

A brief description of the module
Takes a string with a maximum of ??? characters.
No quotation marks are needed

The following can be defined optionally

#% keywords:

The keywords field can be repeated multiple times.
A string used for searching for the command
Takes a string with a maximum of ??? characters. Single words are preferred.
No quotation marks are needed

#% overwrite:

Accepts the generic overwrite flag
Takes values: yes, no

ARGUMENTS

begin with #%option
end with #%end

The following are required

#% key:

A short string identifying the entry field in the GUI
Takes a string with a maximum of ??? characters. Single words or a very few words are preferred.
No quotation marks are needed

The following can be defined optionally

#% description:

A string describing the information needed for the field
Takes a string with a maximum of ??? characters.
No quotation marks are needed

FLAGS

begin with #%flag
end with #%end

The following are required

#% key:

A single character that activates the flag
Takes a string with a maximum of 1 character
No quotation marks are needed

The following can be defined optionally

#% description:

A string describing the information needed for the field
Takes a string with a maximum of ??? characters.
No quotation marks are needed

____________________
C. Michael Barton
Director, Center for Social Dynamics & Complexity
Professor of Anthropology, School of Human Evolution & Social Change
Arizona State University

voice: 480-965-6262 (SHESC), 480-965-8130/727-9746 (CSDC)
fax: 480-965-7671 (SHESC), 480-727-0709 (CSDC)
www: http://www.public.asu.edu/~cmbarton, http://csdc.asu.edu

On Nov 18, 2013, at 5:40 AM, Markus Neteler <neteler@osgeo.org>
wrote:

On Mon, Nov 18, 2013 at 10:15 AM, Maris Nartiss <maris.gis@gmail.com> wrote:

Hello Michael,
recently there was a request about GUI prompting with hints to documentation:
[GRASS-dev] Interface description flag
Right next to the gisprompt is also a pointer to standard options:
GRASS GIS 7 Programmer's Manual: parser_standard_options.c File Reference

I have added the progman link to
Module command line parser - GRASS-Wiki

Markus