[GRASS5] Readline completion for grass

Daniel Calvelo Aros dcalvelo at minag.gob.pe
Thu May 26 16:01:28 EDT 2005


*,

Second installment of readline/bash completion for grass. Now it will also
complete raster, vector, etc. names. And filenames too, where appropriate.

The version I sent yesterday had a bug preventing even activation. Sorry.

To use this, from the grass prompt:

$ . grass_rlcompleter-v1.sh

Then try, e.g.

$ v.in.a<tab> <tab> i<tab>

Or, assuming d.vect.thematic is installed in $GISBASE/scripts

$ d.vect.thematic t<tab>a<tab> th<tab>c<tab>i<tab> map=<tab>

That should get you

$ d.vect.thematic type=area themecalc=interval map=<choose from your list of
available (new) vectors>

Any feedback (including insults) is welcome.

Daniel.

-- Daniel Calvelo Aros

---------- Original Message -----------
From: "Daniel Calvelo Aros" <dcalvelo at minag.gob.pe>
To: grass5 at grass.itc.it
Sent: Thu, 26 May 2005 04:45:21 -0500
Subject: [GRASS5] Readline completion for grass

> Hi all,
> 
> With some recent threads about immediate availability of layers list,
>  column names and so on, I recalled the possibilities of customised 
> tab-completion in bash.
> 
> Here is a first try at having useful tab-completion for grass. The 
> goal is to have mapname, layername, filename, columname completion 
> and so on. For now, just becoming acquainted with readline within 
> bash, I have the following:
> 
> - tab-completion for commands works as always
> - after a command, you have tab-completion for options and flags
> - within options, you have tab-completion for fixed value sets
> 
> I also played along but still didn't integrate layername and database
> columnname completion.
> 
> Please give this a try and comment on it. I'd like to know whether 
> it might be useful enough to complete (sic) it.
> 
> To enable the current features, source this file from bash, e.g. '. filename'.
> If your shell isn't a current enough version of bash, the script 
> will do nothing.
> 
> More to follow, but "release early" as the saying goes.
> 
> Oh, and so many thanks to whomever came up with --interface-
> description in parser.c
> 
> Good night.
> 
> -- Daniel Calvelo Aros
------- End of Original Message -------

-------------- next part --------------
A non-text attachment was scrubbed...
Name: grass_rlcompleter-v1.sh
Type: application/octet-stream
Size: 3495 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/grass-dev/attachments/20050526/3aedaa87/grass_rlcompleter-v1.obj


More information about the grass-dev mailing list