[GRASS-SVN] r33844 - in grass/branches/develbranch_6: include lib/gis

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Oct 12 06:46:47 EDT 2008


Author: martinl
Date: 2008-10-12 06:46:47 -0400 (Sun, 12 Oct 2008)
New Revision: 33844

Modified:
   grass/branches/develbranch_6/include/gis.h
   grass/branches/develbranch_6/lib/gis/parser.c
Log:
new gisprompts - dbcolumn, dbtable, layer


Modified: grass/branches/develbranch_6/include/gis.h
===================================================================
--- grass/branches/develbranch_6/include/gis.h	2008-10-12 09:04:01 UTC (rev 33843)
+++ grass/branches/develbranch_6/include/gis.h	2008-10-12 10:46:47 UTC (rev 33844)
@@ -103,9 +103,7 @@
 #define TYPE_STRING   3
 #define YES           1
 #define NO            0
-#define GISPROMPT_COLOR    "old,color,color"
-#define GISPROMPT_DBCOLUMN "old,dbcolumn,dbcolumn"
-#define GISPROMPT_DBTABLE  "old,dbtable,dbtable"
+#define GISPROMPT_COLOR    "old_color,color,color"
 
 /* File/directory name lengths */
 #define GNAME_MAX 256

Modified: grass/branches/develbranch_6/lib/gis/parser.c
===================================================================
--- grass/branches/develbranch_6/lib/gis/parser.c	2008-10-12 09:04:01 UTC (rev 33843)
+++ grass/branches/develbranch_6/lib/gis/parser.c	2008-10-12 10:46:47 UTC (rev 33844)
@@ -335,7 +335,7 @@
 	Opt->required = NO;
 	Opt->multiple = NO;
 	Opt->description = _("Table name");
-	Opt->gisprompt = GISPROMPT_DBTABLE;
+	Opt->gisprompt = "old_dbtable,dbtable,dbtable";
 	break;
     case G_OPT_DRIVER:
 	Opt->key = "driver";
@@ -360,7 +360,7 @@
 	Opt->required = NO;
 	Opt->multiple = NO;
 	Opt->description = _("Name of attribute column");
-	Opt->gisprompt = GISPROMPT_DBCOLUMN;
+	Opt->gisprompt = "old_dbcolumn,dbcolumn,dbcolumn";
 	break;
     case G_OPT_COLUMNS:
 	Opt->key = "columns";
@@ -369,7 +369,7 @@
 	Opt->required = NO;
 	Opt->multiple = YES;
 	Opt->description = _("Name of attribute column(s)");
-	Opt->gisprompt = GISPROMPT_DBCOLUMN;
+	Opt->gisprompt = "old_dbcolumn,dbcolumn,dbcolumn";
 	break;
 
 	/* imagery group */
@@ -573,6 +573,8 @@
 	Opt->description =
 	    _("A single vector map can be connected to multiple database "
 	      "tables. This number determines which table to use.");
+	Opt->gisprompt = "old_layer,layer,layer";
+	
 	break;
     case G_OPT_V_CAT:
 	Opt->key = "cat";
@@ -2751,17 +2753,10 @@
 	ptr1 = G_ask_old_file("", buff, element, desc);
     else if (!strcmp("new_file", age))	/* file shouldn't exist unless overwrite is enabled */
 	ptr1 = G_ask_new_file("", buff, element, desc);
-    else if (!strcmp("color", age))
-	/* These prompts are only implemented in the gui */
-	/* The data can still be entered in the console */
-	return -1;
     else {
-	fprintf(stderr,
-		"\nPROGRAMMER ERROR: first item in gisprompt is <%s>\n", age);
-	fprintf(stderr,
-		"        Must be either new, old, mapset, any, old_file, new_file, or color\n");
 	return -1;
     }
+    
     if (ptr1 == '\0')
 	*buff = '\0';
 



More information about the grass-commit mailing list