From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13039 invoked by alias); 10 Nov 2013 18:25:11 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 18135 Received: (qmail 26978 invoked from network); 10 Nov 2013 18:25:05 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 From: Bart Schaefer Message-id: <131110102458.ZM21475@torch.brasslantern.com> Date: Sun, 10 Nov 2013 10:24:58 -0800 In-reply-to: Comments: In reply to Thomas Ballinger "custom script Bash completion" (Nov 10, 11:14am) References: X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-users@zsh.org Subject: Re: custom script Bash completion MIME-version: 1.0 Content-type: text/plain; charset=us-ascii 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