bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: feature request (complete)


From: Chet Ramey
Subject: Re: feature request (complete)
Date: Sun, 28 Mar 2010 17:39:39 -0400

> I've been trying to achieve in bash a completion similar to what you 
> can have in zsh but I'm having problems with the output I get from 
> the completion. Is there a way to suppress it?
> 
> It would be useful to have an option, lets say -N, that suppresses 
> the output from the $COMPREPLY, as when invoked from a -F option.
> 
> For example
> 
> complete -o default -N -F _func func
> 
> will still print the matches for the default readline completion, 
> but not if the matches comes from the function _func. In this way we can 
> implement a formatted list of suggestions, to include useful information, 
> and not only the hints.

I'm not sure what you're after here.  If you don't want the matches listed
from $COMPREPLY, why not manipulate the variable yourself?  Why not write a
second function that calls _func, does something with the resulting contents
of $COMPREPLY (e.g., print your formatted list of suggestions), then remove
all the unwanted elements from the array before returning?  For instance,
you could empty the array if there is more than one possible match.

Since the -o default option is in effect only when the other completions
return no matches, this would seem to satisfy your requirements.

Chet

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    address@hidden    http://cnswww.cns.cwru.edu/~chet/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]