[GRASS-dev] Parser checking output maps but not input maps
Glynn Clements
glynn at gclements.plus.com
Mon Jul 6 16:56:55 PDT 2015
Vaclav Petras wrote:
> > > is there some reason for GRASS parser not checking if the input map exists?
> > > It checks if the output map exists and if it it does it ends execution with
> > > an error.
> >
> > If an input map (or file) doesn't exist, you'll get an error when the
> > module tries to open it.
>
> If I understand correctly, this applies only for C modules not Python or
> Bash modules, right?
For scripts which use g.parser for argument parsing, if G_parser()
fails g.parser itself fails, which in turn causes the script to fail.
Python scripts should normally terminate on an exception if a spawned
command fails, whereas shell scripts normally ignore the status of any
spanwed commands.
> In both cases the error is not associated with the
> given option while in case of overwrite it is (which is nice).
Correct.
--
Glynn Clements <glynn at gclements.plus.com>
More information about the grass-dev
mailing list