Glynn Clements wrote: > > > One solution is to merge the support for the -s switch from 7.0. > > > > What does the -s switch do? > > It writes the option settings to stdout then quits, rather than trying > to re-invoke the script with the options added to the environment. > > In 7.0, grass.script.parser() invokes g.parser with the -s switch and > parses its output to initialise the options/flags dictionaries.
I considered extending this feature to shell scripts, writing shell syntax to stdout like with g.gisenv. Unfortunately, this doesn't allow for --interface-description etc. These write text which is supposed to go to the script's stdout, and eval `g.parser ...` would interfere with that. The Python code handles this by checking for the @ARGS_PARSED@ token, parsing the output if this is present and echoing it to stdout otherwise. Doing this in the shell would be somewhat more work (in practice, we'd need a "library" which was sourced by each script), so I'm not sure that it's worth it. -- Glynn Clements <[email protected]> _______________________________________________ grass-dev mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/grass-dev
