[GRASS-SVN] r32453 - grass/trunk/lib/gis

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Aug 2 06:03:23 EDT 2008


Author: martinl
Date: 2008-08-02 06:03:23 -0400 (Sat, 02 Aug 2008)
New Revision: 32453

Modified:
   grass/trunk/lib/gis/parser.c
Log:
parser.c: print 'option <%s>: <%s> exists' message in gui style if GRASS_MESSAGE_FORMAT=gui

Modified: grass/trunk/lib/gis/parser.c
===================================================================
--- grass/trunk/lib/gis/parser.c	2008-08-01 22:57:36 UTC (rev 32452)
+++ grass/trunk/lib/gis/parser.c	2008-08-02 10:03:23 UTC (rev 32453)
@@ -77,6 +77,7 @@
 #include <ctype.h>
 #include <unistd.h>
 #include <stdarg.h>
+#include <sys/types.h>
 #include <grass/gis.h>
 #include <grass/glocale.h>
 #include <grass/spawn.h>
@@ -2604,8 +2605,16 @@
 			    if ( G_find_file (element, opt->answer, G_mapset()) ) /* found */
 			    {
 				if ( !overwrite && !over ) { 
-				    fprintf(stderr, _("ERROR: option <%s>: <%s> exists.\n"), 
-						   opt->key, opt->answer );
+				    if ( G_info_format() != G_INFO_FORMAT_GUI ) {
+					fprintf(stderr, _("ERROR: option <%s>: <%s> exists.\n"), 
+						opt->key, opt->answer );
+				    }
+				    else {
+					fprintf(stderr, "GRASS_INFO_ERROR(%d,1): option <%s>: <%s> exists.\n",
+						getpid(), opt->key, opt->answer);
+					fprintf(stderr, "GRASS_INFO_END(%d,1)\n",
+						getpid());
+				    }
 
 				    error = 1;
 				}



More information about the grass-commit mailing list