[GRASS-dev] [grass.script.core] parser() casts options as strings

Glynn Clements glynn at gclements.plus.com
Wed Jul 29 13:14:13 EDT 2009


Anne Ghisla wrote:

> may I ask why does parser() cast all options arguments as strings
> instead of keeping their types?
> In v.krige.py addon I recast integer options in line 544, before calling
> R functions.
> I also had a look at parser code, but with little success. I'd be glad
> if anyone can guide me in improving it.

The ->answer field in "struct Option" is a char*; it can only hold a
string. Similarly, that's all that g.parser can pass to a script. It's
up to the module or script to parse these to integers or floats where
appropriate.

-- 
Glynn Clements <glynn at gclements.plus.com>


More information about the grass-dev mailing list