[GRASS5] Interfaces ... (long)
Eric G. Miller
egm2 at jps.net
Sat Jul 7 19:27:43 EDT 2001
I've made a few of the minor alterations to XML interface that I
previously mentioned. If everyone is cool with these changes, then I'll
commit them (it will break the proof-of-concept dialog generator that
Jan built).
Changes:
* There is now a distinct element called "flag" separate from
"parameter". It takes an attribute "name", and has an optional
child element for the "description".
* Make both "flag" and "parameter" be children of "task" directly.
This is now the default output, however the DTD still has the
"parameter-group" with children "description", "parameter", and
"flag". It is retained for the future possibility of having
groups of mutually exclusive options. I started to implement such
a thing, but it would require almost a complete rewrite of
parser.c.
* Add a "keydesc" element as an optional child of "parameter". This
corresponds to the "key_desc" member of an Option struct. It has
children called "item", each with an attribute of "order" so that
the proper ordering can be insured for the "tuple".
* Add a "gisprompt" element as an optional child of "parameter".
This is an empty element corresponding to "gisprompt" of the Option
struct. It has three required attributes:
+ "age" - The "age" part of the gisprompt argument ("old", "new",
"any", or "mapset")
+ "element" - The mapset "element" part of the gisprompt
argument ("cell", "dig", "site_lists", etc...)
+ "prompt" - What should be displayed to the user for a prompt.
Example (s.to.vect --interface-description):
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task SYSTEM "grass-interface.dtd">
<task name="s.to.vect">
<description>
Converts a GRASS site_lists file into a vector file.
</description>
<parameter name="input" type="string" required="yes" multiple="no">
<description>
Name of site input file
</description>
<gisprompt age="old" element="site_lists" prompt="site list" />
</parameter>
<parameter name="output" type="string" required="yes" multiple="no">
<description>
Name of vector output file
</description>
<gisprompt age="new" element="dig" prompt="vector" />
</parameter>
<parameter name="cat" type="string" required="no" multiple="no">
<description>
Field type ("string", "dim", or "decimal") and index to use for category value (uses "cat" by default)
</description>
<keydesc>
<item order="1">type</item>
<item order="2">index</item>
</keydesc>
</parameter>
<flag name="p">
<description>
Don't prompt for Map header information
</description>
</flag>
</task>
--
Eric G. Miller <egm2 at jps.net>
More information about the grass-dev
mailing list