[GRASS5] g.parser with multiple=YES ?

Hamish hamish_nospam at yahoo.com
Fri Apr 16 02:06:41 EDT 2004


> > I was just wondering how to use "option->multiple=YES;" in a bash
> > script using g.parser? There seems to be something in the code, but
> > no examples anywhere that I could find.
> 
> Although you can set the multiple flag, the answers field is ignored. 
> I presume that you can still split the $GIS_OPT_* value (taken from
> the answer field) into its components manually.

Yup.
Looking into it, the string is passed regardless; using "multiple: yes"
just changes the "--help" description to input=name[,name,..]. Each item
within the enviro variable string still needs by be parsed with along
the lines of:

ITEM="`echo $GIS_OPT_input | cut -f$NUM -d,`"



Hamish




More information about the grass-dev mailing list