Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Use helper functions for git completion in my own completions
- X-seq: zsh-users 16513
- From: Oliver Kiddle <okiddle@xxxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: Use helper functions for git completion in my own completions
- Date: Tue, 18 Oct 2011 20:50:39 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s1024; t=1318963841; bh=xd3F2YeKACseQkHJKYVgJQz7Wz2YaNkdMga343jr24c=; h=X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Received:Received:In-reply-to:From:References:To:Subject:Date:Message-ID; b=TOXALRBu4N0xiF6JGnGVxvUrAEgFp3yu4xadsg02SuYQv8JKxpRnjFtUnvQAC8la5GrF3VVLqaXPAJlsDk7zi/m/yvQSFCrw0wtE0KWHmWwYeXpAvmHBkF2I8gJbacky9erQEC8jVQsj9krqi5nLQtnITW2C4rFvGLmO/Ae/+j8=
- In-reply-to: <87mxcyv6u6.fsf@deep-thought.43-1.org>
- 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: <87mxcyv6u6.fsf@deep-thought.43-1.org>
Ansgar Burchardt wrote:
> is it possible to use the helper functions defined in "_git" for the git
> command in my own completion functions?
It seems to work if you modify $words in _git-import-dsc, call _git
and rely on it calling you back. As follows:
#compdef git-import-dsc
if [[ $words[1] = git-* ]]; then
words=( ${=words[1]/-/ } ${words[2,-1]} )
_git "$@"
return
fi
The rest of your function can then follow on here and everything in _git
should be defined.
Oliver
Messages sorted by:
Reverse Date,
Date,
Thread,
Author