Hi Nikos, there is a new parser functionality which allows to specify the dependencies.There is no documentation, here are the C functions: http://grass.osgeo.org/programming7/parser__dependencies_8c.html
recently Glynn added this for python scripts to, i am not sure about the syntax, perhaps something like this (just guess): #%rules #% exclusive: -a, -b #% requires_all: opt1, opt2, -a #%end On Fri, Nov 21, 2014 at 11:43 AM, Nikos Alexandris <[email protected]> wrote: > Scripting in Python and defining options and flags in the header, as usual > using the '#%' markers in the beginning of the line and following > g.parser's manual. What if there is need to override an option if another > one is given? > > For example, an option considered as required may be the "mean target > altitude" for i.atcorr's parameter file. What if an elevation map is given, > which renders the previous option not-required? > you can specify that one of mean target altitude and elevation map is required (G_option_required) and that they are exclusive (G_option_exclusive), again, not sure about the Python syntax > > > What is the common practice for this? Define both options as optional and > do the necessary checks inside the script? Or, is there a way to override > options if another option is given in the definition-header? > > Thanks, Nikos > _______________________________________________ > grass-dev mailing list > [email protected] > http://lists.osgeo.org/mailman/listinfo/grass-dev >
_______________________________________________ grass-dev mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/grass-dev
