Commit 36e29fbc authored by Felipe Contreras's avatar Felipe Contreras
Browse files

completion: zsh: improve main function selection



Sometimes we want to use the function directly (e.g. _git_checkout), for
example when zsh has the option 'complete_aliases', this way, we can do
something like:

  compdef _git gco=git_checkout
Signed-off-by: default avatarFelipe Contreras <felipe.contreras@gmail.com>
parent 079fef48
...@@ -214,8 +214,10 @@ _git () ...@@ -214,8 +214,10 @@ _git ()
if (( $+functions[__${service}_zsh_main] )); then if (( $+functions[__${service}_zsh_main] )); then
__${service}_zsh_main __${service}_zsh_main
else elif (( $+functions[__${service}_main] )); then
emulate ksh -c __${service}_main emulate ksh -c __${service}_main
elif (( $+functions[_${service}] )); then
emulate ksh -c _${service}
fi fi
let _ret && _default && _ret=0 let _ret && _default && _ret=0
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment