[GRASS5] New feature: GRASS-specific completion for bash

Alexandre Sorokine sorokin at vtt.co.jp
Fri May 24 12:27:08 EDT 2002


Radim,

Radim Blazek wrote:
> On Friday 24 May 2002 05:51 am, Alexandre Sorokine wrote:
> 
>>Here it is: http://www.acsu.buffalo.edu/~sorokine/complete/
> 
> 
> I have just tested. I like that, it is the feature, I was waiting for.
> Few notes:
> 1) Order of options is obviously alphabetical, may be, that the original 
> order, coded in module is better? It is based on importance of options.

Obviously this is a more ligical way to do it.  Unfortunately current 
version of bash does not give you enough control over how the list of 
completions is printed out for the user.  It looks like bash sorts them 
using something like LC_COLLATE.

> 2) Maybe somehow distinguish optional and required options (map x [type=])
> in list.

Again this is a bash limitation.  My scripts are even aware what 
parameters are optional and what paprameters are required but I cannot 
make any use of it now.

What I can do is to print out a one-line help just before the list of 
completions.

> 3) My wish is to have completion for map names - is it possible? 

Yes, current verion completes on map names, mapsets, monitors and 
colors. In order to get a list of completion for map names your cursor 
should be placed on the position just after the equal sign.

-- 
Alexandre Sorokine
Department of Geography
University at Buffalo
mailto:sorokine at buffalo.edu




More information about the grass-dev mailing list