[GRASS-SVN] r48693 - in grass/branches/develbranch_6: general/manage/cmd lib/gis

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Oct 9 17:17:00 EDT 2011


Author: martinl
Date: 2011-10-09 14:17:00 -0700 (Sun, 09 Oct 2011)
New Revision: 48693

Modified:
   grass/branches/develbranch_6/general/manage/cmd/copy.c
   grass/branches/develbranch_6/general/manage/cmd/remove.c
   grass/branches/develbranch_6/general/manage/cmd/rename.c
   grass/branches/develbranch_6/lib/gis/parser.c
Log:
g.copy/rename/remove: more guisections
libgis: enable forcing overwrite flag


Modified: grass/branches/develbranch_6/general/manage/cmd/copy.c
===================================================================
--- grass/branches/develbranch_6/general/manage/cmd/copy.c	2011-10-09 21:00:40 UTC (rev 48692)
+++ grass/branches/develbranch_6/general/manage/cmd/copy.c	2011-10-09 21:17:00 UTC (rev 48693)
@@ -41,6 +41,7 @@
 	_("Copies available data files in the user's current mapset "
 	  "search path and location to the appropriate element "
 	  "directories under the user's current mapset.");
+    module->overwrite = TRUE;
 
     parm = (struct Option **)G_calloc(nlist, sizeof(struct Option *));
 
@@ -57,6 +58,14 @@
 	p->gisprompt = str;
 	G_asprintf(&str, _("%s file(s) to be copied"), list[n].alias);
 	p->description = str;
+	if (G_strcasecmp(list[n].mainelem, "cell") == 0 ||
+	    G_strcasecmp(list[n].mainelem, "grid3") == 0 ||
+	    G_strcasecmp(list[n].mainelem, "vector") == 0 ||
+	    G_strcasecmp(list[n].mainelem, "windows") == 0 ||
+	    G_strcasecmp(list[n].mainelem, "group") == 0)
+	    p->guisection = _("Basic");
+	else
+	    p->guisection = _("Other");
     }
 
     if (G_parser(argc, argv))

Modified: grass/branches/develbranch_6/general/manage/cmd/remove.c
===================================================================
--- grass/branches/develbranch_6/general/manage/cmd/remove.c	2011-10-09 21:00:40 UTC (rev 48692)
+++ grass/branches/develbranch_6/general/manage/cmd/remove.c	2011-10-09 21:17:00 UTC (rev 48693)
@@ -119,6 +119,14 @@
 	p->gisprompt = str;
 	G_asprintf(&str, _("%s file(s) to be removed"), list[n].alias);
 	p->description = str;
+	if (G_strcasecmp(list[n].mainelem, "cell") == 0 ||
+	    G_strcasecmp(list[n].mainelem, "grid3") == 0 ||
+	    G_strcasecmp(list[n].mainelem, "vector") == 0 ||
+	    G_strcasecmp(list[n].mainelem, "windows") == 0 ||
+	    G_strcasecmp(list[n].mainelem, "group") == 0)
+	    p->guisection = _("Basic");
+	else
+	    p->guisection = _("Other");
     }
 
     if (G_parser(argc, argv))

Modified: grass/branches/develbranch_6/general/manage/cmd/rename.c
===================================================================
--- grass/branches/develbranch_6/general/manage/cmd/rename.c	2011-10-09 21:00:40 UTC (rev 48692)
+++ grass/branches/develbranch_6/general/manage/cmd/rename.c	2011-10-09 21:17:00 UTC (rev 48693)
@@ -40,7 +40,8 @@
     module->keywords = _("general, map management");
     module->description =
 	_("Renames data base element files in the user's current mapset.");
-
+    module->overwrite = TRUE;
+    
     parm = (struct Option **)G_calloc(nlist, sizeof(struct Option *));
 
     for (n = 0; n < nlist; n++) {
@@ -56,6 +57,14 @@
 	p->gisprompt = str;
 	G_asprintf(&str, _("%s file(s) to be renamed"), list[n].alias);
 	p->description = str;
+	if (G_strcasecmp(list[n].mainelem, "cell") == 0 ||
+	    G_strcasecmp(list[n].mainelem, "grid3") == 0 ||
+	    G_strcasecmp(list[n].mainelem, "vector") == 0 ||
+	    G_strcasecmp(list[n].mainelem, "windows") == 0 ||
+	    G_strcasecmp(list[n].mainelem, "group") == 0)
+	    p->guisection = _("Basic");
+	else
+	    p->guisection = _("Other");
     }
 
     if (G_parser(argc, argv))

Modified: grass/branches/develbranch_6/lib/gis/parser.c
===================================================================
--- grass/branches/develbranch_6/lib/gis/parser.c	2011-10-09 21:00:40 UTC (rev 48692)
+++ grass/branches/develbranch_6/lib/gis/parser.c	2011-10-09 21:17:00 UTC (rev 48693)
@@ -1013,6 +1013,9 @@
     char element[KEYLENGTH];
     char desc[KEYLENGTH];
 
+    if (module_info.overwrite)
+	return 1;
+    
     /* figure out if any of the options use a "new" gisprompt */
     /* This is to see if we should spit out the --o flag      */
     if (n_opts) {



More information about the grass-commit mailing list