[GRASS-dev] flags --o and --q in g.parser/scripts?
Glynn Clements
glynn at gclements.plus.com
Sat Jul 14 09:15:45 EDT 2007
Markus Neteler wrote:
> I wonder how to make use of --o (and --q) in shell scripts (have to
> conditionalize a test).
If a script is run with --o, G_parser() will set GRASS_OVERWRITE=1,
which has the same effect as passing --o to every module which is run
from the script.
Similarly, passing --q or --v will set GRASS_VERBOSE to 0 or 3
respectively, which has the same effect as passing --q or --v to every
module which is run from the script.
Rather than checking whether --o, --q or --v were used, you should be
checking $GRASS_OVERWRITE and/or $GRASS_VERBOSE instead. If those
variables are set, the script should behave the same way regardless of
whether they were set by --o, --q or --v being passed to the script or
set by other means.
--
Glynn Clements <glynn at gclements.plus.com>
More information about the grass-dev
mailing list