structure member |
C type |
required |
default |
description and example |
key |
char * |
YES |
none |
Key word used on command line.
opt->key = "map" ; |
type |
int |
YES |
none |
Option type:
TYPE_STRING
TYPE_INTEGER
TYPE_DOUBLE
opt->type = TYPE_STRING ; |
Description |
char * |
YES |
none |
String describing option along with gettext macro for internationalization
opt->description = _("Map name") ; |
answer |
char * |
NO |
NULL |
Default and parser-returned answer to an option.
opt->answer = "defaultmap" ; |
key_desc |
char * |
NO |
NULL |
Single word describing the key. Commas in this string denote
to the parser that several comma-separated arguments are expected
from the user as one answer. For example, if a pair of coordinates
is desired, this element might be defined as follows.
opt->key_desc = "x,y" ; |
structure member |
C type |
required |
default |
description and example |
multiple |
int |
NO |
NO |
Indicates whether the user can provide multiple answers or not.
YES and NO are defined in "gis.h" and should be used (NO is
the default.) Multiple is used in conjunction with the answers
structure member below. opt->multiple = NO ; |
answers |
|
NO |
NULL |
Multiple parser-returned answers to an option. N/A |
required |
int |
NO |
NO |
Indicates whether user MUST provide the option on the command
line. YES and NO are defined in "gis.h" and should be used (NO
is the default.) opt->required = YES ; |
options |
char * |
NO |
NULL |
Approved values or range of values.
opt->options = "red,blue,white" ;
For integers and doubles, the following format is available:
opt->options = "0-1000" ; |
gisprompt |
char * |
NO |
NULL |
Interactive prompt guidance. There are three comma separated
parts to this argument which guide the use of the standard GRASS
file name prompting routines.
opt->gisprompt = "old,cell,raster" ; |
checker |
char *() |
NO |
NULL |
Routine to check the answer to an option
m opt->checker = my_routine() ; |
\subsection Description_of_Complex_Structure_Members Description of Complex Structure Members
What follows are explanations of possibly confusing structure
members. It is intended to clarify and supplement the structures table
above.
\subsection Answer_member_of_the_Flag_and_Option_structures Answer member of the Flag and Option structures
The answer structure member serves two functions for GRASS commands
that use the parser.