[GRASS-SVN] r31770 - grass/trunk/general/g.mapsets

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Jun 20 18:46:20 EDT 2008


Author: neteler
Date: 2008-06-20 18:46:20 -0400 (Fri, 20 Jun 2008)
New Revision: 31770

Modified:
   grass/trunk/general/g.mapsets/main_cmd.c
Log:
resurrected g.mapsets.tcl via flag for nice tcl based selection dialog

Modified: grass/trunk/general/g.mapsets/main_cmd.c
===================================================================
--- grass/trunk/general/g.mapsets/main_cmd.c	2008-06-20 17:10:33 UTC (rev 31769)
+++ grass/trunk/general/g.mapsets/main_cmd.c	2008-06-20 22:46:20 UTC (rev 31770)
@@ -21,6 +21,7 @@
 #include <stdlib.h>
 #include <unistd.h>
 #include <grass/gis.h>
+#include <grass/spawn.h>
 #include <grass/glocale.h>
 #include "local_proto.h"
 #include "externs.h"
@@ -38,10 +39,12 @@
     char **tokens;
     int no_tokens;
     FILE *fp;
+    char   path[GPATH_MAX];
     struct GModule *module;
     struct Option *opt1, *opt2, *opt3;
     struct Flag *print;
     struct Flag *list;
+    struct Flag *tcl;
 
     G_gisinit (argv[0]);
 
@@ -81,6 +84,10 @@
     print->key = 'p';
     print->description = _("Print current mapset search path");
 
+    tcl = G_define_flag();
+    tcl->key = 's';
+    tcl->description = _("Show mapset selection dialog");
+
     Path[0] = '\0';
     nchoices = 0;
 
@@ -93,6 +100,12 @@
 	display_available_mapsets(0);
     }
 
+    if (tcl->answer)
+    {
+        sprintf(path, "%s/etc/g.mapsets.tcl", G_gisbase());
+        G_spawn(path, "g.mapsets.tcl", NULL);
+    }
+
     if (opt1->answer)
     {
 	for (ptr=opt1->answers; *ptr != NULL; ptr++)



More information about the grass-commit mailing list