[GRASS-SVN] r63745 - grass/trunk/general/g.gisenv

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Dec 25 03:53:18 PST 2014


Author: martinl
Date: 2014-12-25 03:53:18 -0800 (Thu, 25 Dec 2014)
New Revision: 63745

Modified:
   grass/trunk/general/g.gisenv/main.c
Log:
g.gisenv: change unset option to be multiple


Modified: grass/trunk/general/g.gisenv/main.c
===================================================================
--- grass/trunk/general/g.gisenv/main.c	2014-12-25 11:51:51 UTC (rev 63744)
+++ grass/trunk/general/g.gisenv/main.c	2014-12-25 11:53:18 UTC (rev 63745)
@@ -9,7 +9,7 @@
  *               Markus Neteler <neteler itc.it>
  *               Martin Landa <landa.martin gmail.com>
  * PURPOSE:      
- * COPYRIGHT:    (C) 2003-2006, 2011-2013 by the GRASS Development Team
+ * COPYRIGHT:    (C) 2003-2014 by the GRASS Development Team
  *
  *               This program is free software under the GNU General Public
  *               License (>=v2). Read the file COPYING that comes with GRASS
@@ -72,7 +72,8 @@
     unset_opt->key_desc = "variable";
     unset_opt->required = NO;
     unset_opt->guisection = _("Set");
-
+    unset_opt->multiple = YES;
+    
     store_opt = G_define_option();
     store_opt->key = "store";
     store_opt->type = TYPE_STRING;
@@ -161,13 +162,17 @@
     }
     
     if (unset_opt->answer) {
-        u_name = parse_variable(unset_opt->answer, &value);
-        if (value)
-            G_warning(_("Value '%s' ignored when unsetting the GRASS variable"),
-                      value);
+        n = 0;
+        while (unset_opt->answers[n]) {
+            u_name = parse_variable(unset_opt->answers[n], &value);
+            if (value)
+                G_warning(_("Value '%s' ignored when unsetting the GRASS variable"),
+                          value);
         
-	G_getenv2(u_name, store); /* G_fatal_error() if not defined */
-	G_unsetenv2(u_name, store);
+            G_getenv2(u_name, store); /* G_fatal_error() if not defined */
+            G_unsetenv2(u_name, store);
+            n++;
+        }
     }
 
     if (u_name)



More information about the grass-commit mailing list