[GRASS-SVN] r38993 - grass/trunk/lib/gis
svn_grass at osgeo.org
svn_grass at osgeo.org
Sat Sep 5 13:05:59 EDT 2009
Author: benducke
Date: 2009-09-05 13:05:59 -0400 (Sat, 05 Sep 2009)
New Revision: 38993
Modified:
grass/trunk/lib/gis/parser.c
Log:
Add G_OPT_V3_TYPE which includes 2D and 3D vector primitives (for now +KERNELS and +FACES)
Modified: grass/trunk/lib/gis/parser.c
===================================================================
--- grass/trunk/lib/gis/parser.c 2009-09-05 17:04:45 UTC (rev 38992)
+++ grass/trunk/lib/gis/parser.c 2009-09-05 17:05:59 UTC (rev 38993)
@@ -60,7 +60,7 @@
* \verbatim
* command num=12
* \endverbatim
- * This command line is in error in two ways. The user will be told
+ * This command line is in error in two ways. The user will be told
* that the "map" option is required and also that the number 12 is
* out of range. The acceptable range (or list) will be printed.
*
@@ -270,7 +270,7 @@
opt->descriptions = NULL;
opt->guisection = NULL;
opt->guidependency = NULL;
-
+
st->current_option = opt;
st->n_opts++;
@@ -300,7 +300,7 @@
* It allocates memory for the Option structure and returns a pointer
* to this memory.
*
- * If an invalid parameter was specified a empty Option structure will
+ * If an invalid parameter was specified a empty Option structure will
* be returned (not NULL).
*
* - general:
@@ -612,6 +612,15 @@
Opt->options = "point,line,boundary,centroid,area";
Opt->description = _("Feature type");
break;
+ case G_OPT_V3_TYPE:
+ Opt->key = "type";
+ Opt->type = TYPE_STRING;
+ Opt->required = NO;
+ Opt->multiple = YES;
+ Opt->answer = "point,line,boundary,centroid,area,face,kernel";
+ Opt->options = "point,line,boundary,centroid,area,face,kernel";
+ Opt->description = _("Feature type");
+ break;
case G_OPT_V_FIELD:
Opt->key = "layer";
Opt->type = TYPE_INTEGER;
@@ -723,7 +732,7 @@
/* Allocate keywords array */
define_keywords();
-
+
return (module);
}
@@ -736,9 +745,9 @@
* the user, and parses this input according to the input options
* and/or flags that were defined by the programmer.
*
- * <b>Note:</b> The only functions which can legitimately be called
+ * <b>Note:</b> The only functions which can legitimately be called
* before G_parser() are:
- *
+ *
* - G_gisinit()
* - G_no_gisinit()
* - G_define_module()
@@ -1043,12 +1052,12 @@
/*!
* \brief Command line help/usage message.
*
- * Calls to G_usage() allow the programmer to print the usage
- * message at any time. This will explain the allowed and required
- * command line input to the user. This description is given according
- * to the programmer's definitions for options and flags. This function
- * becomes useful when the user enters options and/or flags on the
- * command line that are syntactically valid to the parser, but
+ * Calls to G_usage() allow the programmer to print the usage
+ * message at any time. This will explain the allowed and required
+ * command line input to the user. This description is given according
+ * to the programmer's definitions for options and flags. This function
+ * becomes useful when the user enters options and/or flags on the
+ * command line that are syntactically valid to the parser, but
* functionally invalid for the command (e.g. an invalid file name.)
*
* For example, the parser logic doesn't directly support grouping
@@ -1334,7 +1343,7 @@
fprintf(stdout, "\n\t</keywords>\n");
}
- /***** Don't use parameter-groups for now. We'll reimplement this later
+ /***** Don't use parameter-groups for now. We'll reimplement this later
***** when we have a concept of several mutually exclusive option
***** groups
if (st->n_opts || st->n_flags)
@@ -1487,7 +1496,7 @@
}
}
- /***** Don't use parameter-groups for now. We'll reimplement this later
+ /***** Don't use parameter-groups for now. We'll reimplement this later
***** when we have a concept of several mutually exclusive option
***** groups
if (st->n_opts || st->n_flags)
@@ -1752,7 +1761,7 @@
}
/*!
- \brief Print a module parameter template to assist with creating
+ \brief Print a module parameter template to assist with creating
script wrappers.
*/
static void script(void)
@@ -1864,7 +1873,7 @@
}
/*!
- \brief Invoke GUI dialog
+ \brief Invoke GUI dialog
*/
static void module_gui_wx(void)
{
@@ -2617,14 +2626,14 @@
st->module_info.keywords = (const char **) G_realloc(st->module_info.keywords,
st->n_keys_alloc * sizeof(char *));
}
-
+
st->module_info.keywords[st->n_keys++] = G_store(keyword);
}
void print_keywords(FILE *fd, void (*format)(FILE *, const char *))
{
int i;
-
+
for(i = 0; i < st->n_keys; i++) {
if (!format) {
fprintf(fd, "%s", st->module_info.keywords[i]);
@@ -2635,7 +2644,7 @@
if (i < st->n_keys - 1)
fprintf(fd, ", ");
}
-
+
fflush(fd);
}
More information about the grass-commit
mailing list