[GRASS-dev] Interface description flag

Vaclav Petras wenzeslaus at gmail.com
Mon Nov 11 11:25:54 PST 2013


Hi Tyler,

On Mon, Nov 11, 2013 at 1:44 PM, Maris Nartiss <maris.gis at gmail.com> wrote:

> Hello Tyler,
> it's a bit of "black magic" that has historical roots. General
> documentation how it should work is here:
>
> http://grass.osgeo.org/programming7/gislib_cmdline_parsing.html#gisprompt_Member
>
> I did some small updates recently [1] but it was more about readability, I
don't know about this much.

The documentation is far from being usable for something different than C.
Python command line parsing and XML interface description are not
documented.

If you have some ideas or you are willing to document what you are using,
we can incorporate this into the manual.

Vaclav

[1] http://lists.osgeo.org/pipermail/grass-dev/2013-October/066084.html

Hope it helps for a start.
> Maris.
>
>
> 2013/10/31 Tyler Smith <tyler at plantarum.ca>:
> > 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
> > _______________________________________________
> > grass-dev mailing list
> > grass-dev at lists.osgeo.org
> > http://lists.osgeo.org/mailman/listinfo/grass-dev
> _______________________________________________
> grass-dev mailing list
> grass-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-dev/attachments/20131111/c3a459b4/attachment-0001.html>


More information about the grass-dev mailing list