How do I get bash completion to work with aliases?

后端 未结 12 1073
温柔的废话
温柔的废话 2020-11-28 00:35

Case in point:

I\'m a on mac with bash v3.2.17, I\'m using git installed via macports with the bash_completion variant.

When I type git checkout m<

12条回答
  •  伪装坚强ぢ
    2020-11-28 01:07

    As stated in the comments above,

    complete -o default -o nospace -F _git_checkout gco
    

    will no longer work. However, there's a __git_complete function in git-completion.bash which can be used to set up completion for aliases like so:

    __git_complete gco _git_checkout
    

提交回复
热议问题