do you think we can remove the -v flag from d.vect module? I don't
think it is used in scripts, etc.
No, not during GRASS 6.x. While it may not be used in any official
scripts it may break a users' scripts.
To prepare for it's removal in GRASS 7 you can modify the -v flag to
assert GRASS_VERBOSE=x and print a G_warning("-v depreciated"), and then
modify the module's "quiet=" code to set itself based on the
GRASS_VERBOSEity level. Then when GRASS 7 comes out it is simple to
remove it.
e.g. as Jachym has done for r.buffer.
I see it is pretty useless. I guess you could rip out the two calls to
it and change the flag's description to -v "unused, will be removed in
future". I guess it is useful for d.vect from the GUI, but then it
should use G_message() and G_done_msg() which obey --quiet, and have no
-v flag. i.e. it isn't always clear when a module which runs in a GUI
window has finished, so in that situation these messages are quiet nice.
It also would be nice if G_done_msg() could trigger a green check-mark
/ graphic when complete, as G_warning() triggers a "!" and
\/ G_fatal_error() triggers a "X" in the GUI output.
Martin Landa wrote:
> do you think we can remove the -v flag from d.vect module? I don't
> think it is used in scripts, etc.
No, not during GRASS 6.x. While it may not be used in any official
scripts it may break a users' scripts.
To prepare for it's removal in GRASS 7 you can modify the -v flag to
assert GRASS_VERBOSE=x and print a G_warning("-v depreciated"), and then
modify the module's "quiet=" code to set itself based on the
GRASS_VERBOSEity level. Then when GRASS 7 comes out it is simple to
remove it.
e.g. as Jachym has done for r.buffer.
I see it is pretty useless. I guess you could rip out the two calls to
it and change the flag's description to -v "unused, will be removed in
future". I guess it is useful for d.vect from the GUI, but then it
should use G_message() and G_done_msg() which obey --quiet, and have no
-v flag. i.e. it isn't always clear when a module which runs in a GUI
window has finished, so in that situation these messages are quiet nice.
It also would be nice if G_done_msg() could trigger a green check-mark
/ graphic when complete, as G_warning() triggers a "!" and
\/ G_fatal_error() triggers a "X" in the GUI output.
> > do you think we can remove the -v flag from d.vect module? I don't
> > think it is used in scripts, etc.
..
> To prepare for it's removal in GRASS 7 you can modify the -v flag to
> assert GRASS_VERBOSE=x and print a G_warning("-v depreciated"), and
> then modify the module's "quiet=" code to set itself based on the
> GRASS_VERBOSEity level. Then when GRASS 7 comes out it is simple to
> remove it.
..
done in CVS (I hope;-)
Hi Martin,
I just made a few more slight refinements to this in CVS.
Standard verbosity level is "2", max is "3". putenv(=2) would override
--verbose (which now sets v=3).
I have just added a new G_verbose_std() fn to take care of this:
int verbose=FALSE;
if(G_verbose() > G_verbose_std())
verbose=TRUE;
So it should be cleaner to set verbose mode in future.
I used G_putenv() instead of putenv(). (sorry r.buffer example I gave uses
putenv(), but as it's POSIX it's everywhere so I doubt this change makes
much of a difference)
I put the verbose tests back in for the G_message() and G_done_msg()
calls; you don't want d.vect chatty by default when called from the
command line, only when --verbose (or -v) was used.