[Top][All Lists]

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

Re: [Help-bash] Command completion with * in the middle?

From: doark
Subject: Re: [Help-bash] Command completion with * in the middle?
Date: Sat, 26 Jan 2019 19:23:45 -0500

On Sun, 20 Jan 2019 17:50:00 -0500
Chet Ramey <address@hidden> wrote:

> On 1/20/19 5:48 PM, Grisha Levit wrote:
> > On Sat, Jan 19, 2019 at 11:54 PM David Niklas <address@hidden> wrote:
> >
> >> Sadly, if there is such a way, I'm still searching for it...
> >>
> >
> > I think something like this does the trick?
> >
> >     f() { COMPREPLY=($(compgen -c -X '!'"$3")); }
> >     complete -I -F f -o bashdefault
> >
> > i.e. generate all commands and then remove the ones that don't match
> > the pattern supplied.
> Ooh, that's clever.

Maybe not so much...
% complete -I -F f -o bashdefault
bash: complete: -I: invalid option

I did read bash's man page and there are a lot of unexplained options to
Also, and this maybe a bit naive of me, but even after removing -I I
still have a problem of complete not knowing what to complete. That is to
say, I get the usage of complete when invoking it.
Feel free to point me to the fine manuals. :)


reply via email to

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