[GRASS-dev] [bug #4524] (grass) v.clean, v.patch (else?): output to stderr instead of stdout...

this bug's URL: http://intevation.de/rt/webrt?serial_num=4524
-------------------------------------------------------------------------

Subject: v.clean, v.patch (else?): output to stderr instead of stdout...

Platform: GNU/Linux/x86
grass obtained from: CVS
grass binary for platform: Compiled from Sources
GRASS Version: 2006-05-30

...and it is hard to prevent such commands from being verbose when not supposed to, "> /dev/null" doesn't help.

Especially v.clean is a big mouth.

It is a pain in user's scripts.

Maciek

-------------------------------------------- Managed by Request Tracker

this bug's URL: http://intevation.de/rt/webrt?serial_num=4524
---------------------------------------------------------------------

Subject: v.clean, v.patch (else?): output to stderr instead of
stdout...

..

GRASS Version: 2006-05-30

...and it is hard to prevent such commands from being verbose when not
supposed to, "> /dev/null" doesn't help.

"2> /dev/null" might help, but then you might lose error/warnings.

Especially v.clean is a big mouth.

v.patch:
    Vect_build (&OutMap, stdout);
    Vect_close (&OutMap);

    fprintf (stderr, "Patch complete. %d files patched.\n", n_files);
    fprintf (stderr, "Intersections at borders will have to be snapped.\n");
    fprintf (stderr, "Lines common between files will have to be edited.\n");
    fprintf (stderr, "The header information also may have to be edited.\n");

As discussed recently on grass5, those fprintf's should use G_message(),
then G_message(),G_percent() should check some verbosity variable.

This will clean up a lot.

Vect_build() is harder as the intended output is specific. Modify each
module that uses Vect_build() or test in Vect_build() for != "std*"?

Hamish

Hi, just a short note - in case of v.patch, fprintf (stderr, ...) ->
G_message () [1].

Best, Martin

[1] http://freegis.org/cgi-bin/viewcvs.cgi/grass6/vector/v.patch/main.c.diff?r1=1.11&r2=1.12

2006/5/31, Hamish <hamish_nospam@yahoo.com>:

> this bug's URL: http://intevation.de/rt/webrt?serial_num=4524
> ---------------------------------------------------------------------
>
> Subject: v.clean, v.patch (else?): output to stderr instead of
> stdout...
..
> GRASS Version: 2006-05-30
>
> ...and it is hard to prevent such commands from being verbose when not
> supposed to, "> /dev/null" doesn't help.

"2> /dev/null" might help, but then you might lose error/warnings.

> Especially v.clean is a big mouth.

v.patch:
   Vect_build (&OutMap, stdout);
   Vect_close (&OutMap);

   fprintf (stderr, "Patch complete. %d files patched.\n", n_files);
   fprintf (stderr, "Intersections at borders will have to be snapped.\n");
   fprintf (stderr, "Lines common between files will have to be edited.\n");
   fprintf (stderr, "The header information also may have to be edited.\n");

As discussed recently on grass5, those fprintf's should use G_message(),
then G_message(),G_percent() should check some verbosity variable.

This will clean up a lot.

Vect_build() is harder as the intended output is specific. Modify each
module that uses Vect_build() or test in Vect_build() for != "std*"?

Hamish

_______________________________________________
grass-dev mailing list
grass-dev@grass.itc.it
http://grass.itc.it/mailman/listinfo/grass-dev

Hi, just a short note - in case of v.patch, fprintf (stderr, ...) ->
G_message () [1].

..
http://freegis.org/cgi-bin/viewcvs.cgi/grass6/vector/v.patch/main.c.diff?r1=1.11&r2=1.12

It appears that I am behind the times. Sorry.

new content:

G_done_msg() should check a GRASS_{VERBOSE|QUIET} enviro var, as well
as G_message() and G_percent().

Hamish