Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: custom script Bash completion
- X-seq: zsh-users 18135
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: custom script Bash completion
- Date: Sun, 10 Nov 2013 10:24:58 -0800
- In-reply-to: <CABb6=DWg_P+E+WvRzxZPnWDRN2jbL1Xh3P6tAMdHx+pmvCTdMA@mail.gmail.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <CABb6=DWg_P+E+WvRzxZPnWDRN2jbL1Xh3P6tAMdHx+pmvCTdMA@mail.gmail.com>
On Nov 10, 11:14am, Thomas Ballinger wrote:
>
> I'd like to use bash completion in zsh for a script with
>
> complete -C 'tu --get-bash-completion' tu
>
> 'tu --get-bash-completion' is invoked by zsh completion, but the three
> arguments bash would pass to it aren't being passed.
I'm not absolutely sure if the following explains that, because none of
the bash man pages I can find describe what those three arguments are,
but: The zsh bash completions are compatible with bash 2.05b and it is
possible that those three arguments were not passed by that version.
Volunteers to update Completion/bashcompinit?
> Is there another config option I need to know about, or is this behavior
> not implemented?
Based on a quick peek at "compgen" in bashcompinit and a couple of stabs
with "complete -C /bin/echo foo" in bash itself, Thomas is expecting the
external command defined with "complete -C" to receive the same three
arguments that are passed to a shell function with "complete -F".
So the workaround for this particular anomaly is to do
tu_completer() {
echo $(tu --get-bash-completion "$@")
}
complete -F tu_completer tu
Messages sorted by:
Reverse Date,
Date,
Thread,
Author