[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: compgen -I (programmable completion as if initial word)
From: |
Chet Ramey |
Subject: |
Re: compgen -I (programmable completion as if initial word) |
Date: |
Wed, 25 Sep 2024 16:06:20 -0400 |
User-agent: |
Mozilla Thunderbird |
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 chet@case.edu http://tiswww.cwru.edu/~chet/