[GRASS-SVN] r70617 - in grass/branches/releasebranch_7_2: include lib/gis

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Feb 18 06:55:19 PST 2017


Author: martinl
Date: 2017-02-18 06:55:19 -0800 (Sat, 18 Feb 2017)
New Revision: 70617

Modified:
   grass/branches/releasebranch_7_2/include/gis.h
   grass/branches/releasebranch_7_2/lib/gis/parser.c
   grass/branches/releasebranch_7_2/lib/gis/parser_local_proto.h
Log:
libgis: add suppress overwrite attribute (see #3270)


Modified: grass/branches/releasebranch_7_2/include/gis.h
===================================================================
--- grass/branches/releasebranch_7_2/include/gis.h	2017-02-18 14:39:37 UTC (rev 70616)
+++ grass/branches/releasebranch_7_2/include/gis.h	2017-02-18 14:55:19 UTC (rev 70617)
@@ -540,6 +540,7 @@
     char key;			/*!< Key char used on command line */
     char answer;		/*!< Stores flag state: 0/1 */
     char suppress_required;	/*!< Suppresses checking of required options */
+    char suppress_overwrite;	/*!< Suppresses checking of existing output */
     const char *label;		/*!< Optional short label, used in GUI as item label */
     const char *description;	/*!< String describing flag meaning   */
     const char *guisection;	/*!< GUI Layout guidance: ';' delimited hierarchical tree position */

Modified: grass/branches/releasebranch_7_2/lib/gis/parser.c
===================================================================
--- grass/branches/releasebranch_7_2/lib/gis/parser.c	2017-02-18 14:39:37 UTC (rev 70616)
+++ grass/branches/releasebranch_7_2/lib/gis/parser.c	2017-02-18 14:55:19 UTC (rev 70617)
@@ -624,8 +624,10 @@
 	return -1;
     }
 
-    if (check_overwrite())
-	return -1;
+    if (!st->suppress_overwrite) {
+        if (check_overwrite())
+            return -1;
+    }
 
     return 0;
 }
@@ -972,6 +974,8 @@
 	    flag->answer = 1;
 	    if (flag->suppress_required)
 		st->suppress_required = 1;
+	    if (flag->suppress_overwrite)
+		st->suppress_overwrite = 1;
 	    return;
 	}
 	flag = flag->next_flag;

Modified: grass/branches/releasebranch_7_2/lib/gis/parser_local_proto.h
===================================================================
--- grass/branches/releasebranch_7_2/lib/gis/parser_local_proto.h	2017-02-18 14:39:37 UTC (rev 70616)
+++ grass/branches/releasebranch_7_2/lib/gis/parser_local_proto.h	2017-02-18 14:55:19 UTC (rev 70617)
@@ -21,6 +21,7 @@
     int quiet;
     int has_required;
     int suppress_required;
+    int suppress_overwrite;
 
     struct GModule module_info;	/* general information on the corresponding module */
 



More information about the grass-commit mailing list