[GRASS-dev] how to deal with the @mapset in scripts?

Glynn Clements glynn at gclements.plus.com
Wed Jul 4 11:35:27 EDT 2007


Maciej Sieczka wrote:

> >>> Why do you actually need to use g.findfile? In most cases, you should
> >>> just pass the map name directly to the command, and let the command
> >>> handle the checking.
> >> It's better to check if the output exists in the initial stage of my
> >> script, than to let it run for an hour and then fail with an error that
> >> the output already exists in the end.
> > 
> > If the output map is specified by an option whose "gisprompt" setting
> > includes "new", g.parser will automatically ensure that it doesn't
> > exist unless --o[verwrite] is given or $GRASS_OVERWRITE == 1.
> 
> You are correct. The reason that this has not worked for me like that
> is that I've been using "gisprompt: new,dig,vector" instead of
> "gisprompt: new,vector,vector".
> 
> I must have copied this "gisprompt: new,dig,vector" from some GRASS 5
> script and sticked to that. None of the scripts in 6.3 uses it. Is this
> not supposed to be recognised by g.parser indeed? There isn't any error
> message that this is incorrect. Should there be one?

g.parser is just a front-end to G_parser(). The syntax of "valid"
options is essentially whatever G_parser() accepts. In turn,
G_parser() silently ignores any gisprompt keys which it doesn't
understand.

> Grepping through the GRASS 6.3 source code I can see that v.surf.rst
> still uses the old syntax in main.c twice. Should that be fixed?

Probably.

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




More information about the grass-dev mailing list