Custom zsh completion for a function based on default arguments

前端 未结 1 1842
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-03 10:43

How can I setup completion for a function, based on existing completion definitions and default arguments.

A simplified example (which could be rewritten as an alias

相关标签:
1条回答
  • 2021-01-03 10:52
    compdef -e 'words[1]=(git pull origin); service=git; (( CURRENT+=2 )); _git' ggl
    

    This massages the $words, $service and $CURRENT vars used by the completion system, and then calls the _git completion function.

    (Thanks to Mikachu on #zsh).

    0 讨论(0)
提交回复
热议问题