[GRASS-dev] Interface description flag

Tyler Smith tyler at plantarum.ca
Thu Oct 31 07:17:09 PDT 2013


Hello,

(sorry if this gets posted multiple times, I'm having email problems at my end)

I'm developing an Emacs mode for interacting with the GRASS process,
available here:

https://bitbucket.org/tws/grass-mode.el/wiki/Home

One of the features of this mode is offering tab-completion of command
parameters. I use a lookup-table for this, populated by running all
the programs in the bin/ directory with the -interface-description
flag and parsing their output. This works fine for parameters that
have a set list of possible values, like d.vect icon.

However, I also have utility functions that provide completion of
vector and raster map names. I don't understand the output of
--interface-description well enough to know if there's a way to
automatically identify parameters that should be completed with a
vector name lookup. For example, all of the following combinations are
completed by a vector map file:

v.convert input= d.vect map= r.volume centroids= v.split input=

I notice that each of them has the following item in their <parameter> tag:

<gisprompt age="old" element="dig" prompt="vector" />

The age and element values differ, but all four have prompt="vector".

Can I use this to identify parameters that take a vector file name?
That is, is the value of <gisprompt prompt="vector"> present for all
commands that should be completed by a vector map name, and is this
value absent from all other parameters?

If not, is their another way to get this information directly from the programs?

Thanks for your help,

Tyler


More information about the grass-dev mailing list