On 9/24/24 3:15 PM, Stephen Gildea wrote:
I would like these two partially entered commands to complete the
same way:

$ ca<Tab>
$ sudo ca<Tab>

The first completion nicely takes into account any previous
"complete -I" setting (because it is completing the initial
word of a command).

But the second completion relies on a programmable completion,
and in Bash 5.2 it is hard to program the same behavior.  In
particular, the programmed completion cannot easily tell Bash
to obey my -I setting.

I can get _almost_ the same effect by having the "sudo" compspec
run "compgen -c" (generate completions over command names), but
that would ignore my -I setting.

I would like to be able to say "compgen -I" in my compspec and
have Bash generate completions as if this were the initial
word of a command, applying whatever settings it would to an
actual initial word.

Thanks for the suggestion. I will add it to the requested feature list
for a future bash version.

Chet


--
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    c...@case.edu    http://tiswww.cwru.edu/~chet/

Reply via email to