[GRASS-SVN] r65854 - in grass/branches/releasebranch_7_0: display/d.mon lib/gis raster/r.mapcalc raster/r.proj vector/v.external vector/v.proj

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Aug 8 03:15:13 PDT 2015


Author: neteler
Date: 2015-08-08 03:15:13 -0700 (Sat, 08 Aug 2015)
New Revision: 65854

Modified:
   grass/branches/releasebranch_7_0/display/d.mon/start.c
   grass/branches/releasebranch_7_0/lib/gis/parser.c
   grass/branches/releasebranch_7_0/raster/r.mapcalc/evaluate.c
   grass/branches/releasebranch_7_0/raster/r.proj/main.c
   grass/branches/releasebranch_7_0/vector/v.external/main.c
   grass/branches/releasebranch_7_0/vector/v.proj/main.c
Log:
Existing map case: improve overwrite user msg (trunk, r65853)

Modified: grass/branches/releasebranch_7_0/display/d.mon/start.c
===================================================================
--- grass/branches/releasebranch_7_0/display/d.mon/start.c	2015-08-08 10:14:26 UTC (rev 65853)
+++ grass/branches/releasebranch_7_0/display/d.mon/start.c	2015-08-08 10:15:13 UTC (rev 65854)
@@ -35,7 +35,7 @@
             }
             else {
                 D_close_driver();
-                G_fatal_error(_("option <%s>: <%s> exists."),
+                G_fatal_error(_("option <%s>: <%s> exists. To overwrite, use the --overwrite flag"),
                               "output", output_name);
             }
         }

Modified: grass/branches/releasebranch_7_0/lib/gis/parser.c
===================================================================
--- grass/branches/releasebranch_7_0/lib/gis/parser.c	2015-08-08 10:14:26 UTC (rev 65853)
+++ grass/branches/releasebranch_7_0/lib/gis/parser.c	2015-08-08 10:15:13 UTC (rev 65854)
@@ -1469,14 +1469,18 @@
 			if (!st->overwrite && !over) {
                             if (G_verbose() > -1) {
                                 if (G_info_format() != G_INFO_FORMAT_GUI) {
+                                    fprintf(stderr, _("ERROR: "));
                                     fprintf(stderr,
-                                            _("ERROR: option <%s>: <%s> exists.\n"),
+                                            _("option <%s>: <%s> exists. To overwrite, use the --overwrite flag"),
                                             opt->key, opt->answers[i]);
+                                    fprintf(stderr, "\n");
                                 }
                                 else {
+                                    fprintf(stderr, _("GRASS_INFO_ERROR(%d,1): "));
                                     fprintf(stderr,
-                                            "GRASS_INFO_ERROR(%d,1): option <%s>: <%s> exists.\n",
+                                            "option <%s>: <%s> exists. To overwrite, use the --overwrite flag",
                                             getpid(), opt->key, opt->answers[i]);
+                                    fprintf(stderr, "\n");
                                     fprintf(stderr, "GRASS_INFO_END(%d,1)\n",
                                             getpid());
                                 }

Modified: grass/branches/releasebranch_7_0/raster/r.mapcalc/evaluate.c
===================================================================
--- grass/branches/releasebranch_7_0/raster/r.mapcalc/evaluate.c	2015-08-08 10:14:26 UTC (rev 65853)
+++ grass/branches/releasebranch_7_0/raster/r.mapcalc/evaluate.c	2015-08-08 10:15:13 UTC (rev 65854)
@@ -279,7 +279,7 @@
 	var = e->data.bind.var;
 
 	if (!overwrite_flag && check_output_map(var))
-	    G_fatal_error(_("output map <%s> exists"), var);
+	    G_fatal_error(_("output map <%s> exists. To overwrite, use the --overwrite flag"), var);
     }
 
     for (l = ee; l; l = l->next) {

Modified: grass/branches/releasebranch_7_0/raster/r.proj/main.c
===================================================================
--- grass/branches/releasebranch_7_0/raster/r.proj/main.c	2015-08-08 10:14:26 UTC (rev 65853)
+++ grass/branches/releasebranch_7_0/raster/r.proj/main.c	2015-08-08 10:15:13 UTC (rev 65854)
@@ -242,7 +242,8 @@
     if (mapname && !list->answer && !overwrite &&
 	!print_bounds->answer && !gprint_bounds->answer &&
 	G_find_raster(mapname, G_mapset()))
-	G_fatal_error(_("option <%s>: <%s> exists."), "output", mapname);
+	G_fatal_error(_("option <%s>: <%s> exists. To overwrite, use the --overwrite flag"),
+                      "output", mapname);
 
     setname = imapset->answer ? imapset->answer : G_store(G_mapset());
     if (strcmp(inlocation->answer, G_location()) == 0 &&

Modified: grass/branches/releasebranch_7_0/vector/v.external/main.c
===================================================================
--- grass/branches/releasebranch_7_0/vector/v.external/main.c	2015-08-08 10:14:26 UTC (rev 65853)
+++ grass/branches/releasebranch_7_0/vector/v.external/main.c	2015-08-08 10:15:13 UTC (rev 65854)
@@ -136,7 +136,7 @@
     G_debug(2, "layer '%s' was found", options.layer->answer);
 
     if (G_find_vector2(output, G_mapset()) && !G_check_overwrite(argc, argv)) {
-        G_fatal_error(_("option <%s>: <%s> exists."),
+        G_fatal_error(_("option <%s>: <%s> exists. To overwrite, use the --overwrite flag"),
                       options.output->key, output);
     }
     

Modified: grass/branches/releasebranch_7_0/vector/v.proj/main.c
===================================================================
--- grass/branches/releasebranch_7_0/vector/v.proj/main.c	2015-08-08 10:14:26 UTC (rev 65853)
+++ grass/branches/releasebranch_7_0/vector/v.proj/main.c	2015-08-08 10:15:13 UTC (rev 65854)
@@ -141,7 +141,7 @@
 	omap_name = map_name;
     if (omap_name && !flag.list->answer && !overwrite &&
 	G_find_vector2(omap_name, G_mapset()))
-	G_fatal_error(_("option <%s>: <%s> exists."), omapopt->key,
+	G_fatal_error(_("option <%s>: <%s> exists. To overwrite, use the --overwrite flag"), omapopt->key,
 		      omap_name);
     if (isetopt->answer)
 	iset_name = isetopt->answer;



More information about the grass-commit mailing list