[GRASS-dev] Re: another question about scripting GUI

Glynn Clements glynn at gclements.plus.com
Tue Dec 1 04:35:33 EST 2009


Michael Barton wrote:

> If all the elements in parser_standard_options.c work, should they be  
> added to element_list?
> 
> e.g., old_dbtable,dbtable,dbtable

No. The element_list file affects G_find_file(), g.copy etc. If you
add new types to that file, they will show up as valid options for
g.copy etc. Don't add anything which doesn't correspond to a
subdirectory of the mapset directory.

The format of the gisprompt field only matters insofar as the first
field (age) is either old, new, mapset, any, old_file or new_file.

Those values are understood by G_parser(), and cause the second field
(element) to be treated as an element type. This mostly affects
terminal-based prompting (which only occurs if GRASS_UI_TERM is set),
but is also used by the overwrite check. If the age field isn't one of
those values, the parser doesn't try to interpret the other fields.

In 7.0, the terminal-based interaction has been removed, so gisprompt
can contain almost anything. The "almost" being that if the first
field is "new", the second field must be a valid element name; unless
overwrite is enabled, the parser will check that the element doesn't
already exist. Also, if any option has an age of "new", the --help etc
output will mention the --overwrite flag, otherwise it won't.

-- 
Glynn Clements <glynn at gclements.plus.com>


More information about the grass-dev mailing list