[GRASS-dev] G_program_name to every message / r.li

Glynn Clements glynn at gclements.plus.com
Mon Jan 8 10:25:04 EST 2007


Brad Douglas wrote:

> > What about adding G_program_name(); to every message, so that 
> > 
> >     G_message("Hallo, world!");
> >     
> > would produce
> > 
> >     g.module: Hallo, world!
> 
> Why?  This amounts to spam, IMHO.  Some module names are 30 characters
> wide (I'm looking at you, r.li)!  That's nearly half the terminal
> length.

I can see it being useful, for the reasons Jachym gives; however:

1. It should be optional (although with all of these environment
variables, I'm starting to worry about platforms which have a 4KiB
limit on the combined size of the command line and the environment).

2. It might be better to put it on a line by itself, and only display
it for the first message or warning, so:

	G_message("Hello,");
	G_message("World!");

would produce e.g.:

	* g.module:
	Hello,
	World!

rather than:

	g.module: Hello,
	g.module: World!

This would be preferable in the cases of modules with long names and
modules which are particularly verbose.

-- 
Glynn Clements <glynn at gclements.plus.com>




More information about the grass-dev mailing list