[GRASS-dev] flags --o and --q in g.parser/scripts?

Hi,

I wonder how to make use of --o (and --q) in shell scripts (have to
conditionalize a test).

Markus
--
View this message in context: http://www.nabble.com/flags---o-and---q-in-g.parser-scripts--tf4078828.html#a11593116
Sent from the Grass - Dev mailing list archive at Nabble.com.

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@gclements.plus.com>