[GRASS-dev] new module: g.message

Markus Neteler neteler at itc.it
Fri Mar 23 07:04:14 EDT 2007


Jachym Cepicky wrote on 03/23/2007 10:56 AM:
> 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
I have changed -f to -e to be more intuitive for script programmers
(as personally discussed with Jachym).

>
> 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?
Yes!

> Shall I update SUBMITTING_SCRIPTS accordingly?
Also yes. If possible, it would be good to update as many scripts
as possible with some perl/python/whatever converter since new
scripts are often derived from existing ones.

Markus


------------------
ITC -> dall'1 marzo 2007 Fondazione Bruno Kessler
ITC -> since 1 March 2007 Fondazione Bruno Kessler
------------------




More information about the grass-dev mailing list