Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Use helper functions for git completion in my own completions



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