[GRASS-dev] new module: g.message

Jachym Cepicky jachym.cepicky at gmail.com
Fri Mar 23 05:56:07 EDT 2007


Hi developers,

I added new module - g.message - to cvs, which should be used in shell
(and other scripts). It's purpose is to replace echo commands for
printing (progress) messages. Flags for fatal error and warning (and
debug) are available too.

Sample usage:

GRASS> g.message "Reprojecting maps"
"Reprojecting maps"

GRASS> g.message -w "Coordinate system not set, using default"
WARNING: Coordinate system not set, using default

GRASS> g.message -f "Input map not found"
ERROR: Input map not found

Advantages:
- Scripts will be able to print messages according to GRASS_VERBOSE variable
- Keywords will be translated
- Long messages will be formated according to GRASS settings
- All messages will be printed to STDERR automaticly

Questions:
Do you think, it is a good idea?
Shall I update SUBMITTING_SCRIPTS accordingly?

Jachym
-- 
Jachym Cepicky
e-mail: jachym.cepicky gmail com
URL: http://les-ejk.cz
GPG: http://www.les-ejk.cz/pgp/jachym_cepicky-gpg.pub




More information about the grass-dev mailing list