[GRASS-SVN] r68092 - grass/trunk/lib/gis
svn_grass at osgeo.org
svn_grass at osgeo.org
Mon Mar 21 03:14:09 PDT 2016
Author: mlennert
Date: 2016-03-21 03:14:09 -0700 (Mon, 21 Mar 2016)
New Revision: 68092
Modified:
grass/trunk/lib/gis/parser.c
grass/trunk/lib/gis/parser_help.c
Log:
parser: add superquiet flag that suppresses non-fatal warnings (#2967 - patch by rouault)
Modified: grass/trunk/lib/gis/parser.c
===================================================================
--- grass/trunk/lib/gis/parser.c 2016-03-21 06:37:26 UTC (rev 68091)
+++ grass/trunk/lib/gis/parser.c 2016-03-21 10:14:09 UTC (rev 68092)
@@ -539,6 +539,21 @@
st->quiet = 1; /* for passing to gui init */
}
+ /* Super quiet option */
+ else if (strcmp(ptr, "--qq") == 0 ) {
+ char buff[32];
+
+ /* print nothing, but errors */
+ st->module_info.verbose = G_verbose_min();
+ sprintf(buff, "GRASS_VERBOSE=%d", G_verbose_min());
+ putenv(G_store(buff));
+ G_suppress_warnings(TRUE);
+ if (st->quiet == -1) {
+ G_warning(_("Use either --qq or --verbose flag, not both. Assuming --qq."));
+ }
+ st->quiet = 1; /* for passing to gui init */
+ }
+
/* Force gui to come up */
else if (strcmp(ptr, "--ui") == 0) {
force_gui = TRUE;
Modified: grass/trunk/lib/gis/parser_help.c
===================================================================
--- grass/trunk/lib/gis/parser_help.c 2016-03-21 06:37:26 UTC (rev 68091)
+++ grass/trunk/lib/gis/parser_help.c 2016-03-21 10:14:09 UTC (rev 68092)
@@ -202,6 +202,7 @@
fprintf(fp, " --h %s\n", _("Print usage summary"));
fprintf(fp, " --v %s\n", _("Verbose module output"));
fprintf(fp, " --q %s\n", _("Quiet module output"));
+ fprintf(fp, " --qq %s\n", _("Super quiet module output"));
fprintf(fp, " --ui %s\n", _("Force launching GUI dialog"));
/* Print help info for options */
More information about the grass-commit
mailing list