[Bash-completion-devel] RFC: Turn on -o filenames in _filedir() if compopt is available

Crestez Dan Leonard cdleonard at gmail.com
Mon Nov 30 20:15:18 UTC 2009


On Mon, 2009-11-30 at 21:50 +0200, Ville Skyttä wrote:
> On Monday 30 November 2009, Crestez Dan Leonard wrote:
> > > (No strong opinions whether the test should be
> > > "type compopt &>/dev/null" or "${BASH_VERSINFO[0]} -ge 4" but I like
> > > the former a bit better.)
> > 
> > compopt is so very useful it might be worth creating a _compopt wrapper
> 
> There actually was one (although badly implemented) for a while but it was 
> removed because it was not used nor seen necessary.
I tried sending two patches and both times I felt the need to use
compopt.

> > which does nothing but return an error on bash < 4.
> 
> I don't think returning an error would be acceptable, but aliasing it to 
> "true" or some other no-op that always succeeds but does nothing could be.
Bash documentation claims compopt returns an error on unknown options.
Returning an error would sort of make sense since nothing is supported
on bash3. Silently ignoring the call would work too.

> By the way did you intend to reply only to me or to the bash-completion list?
I intended to reply to list; sorry.




More information about the Bash-completion-devel mailing list