How to add bash command completion for Docker on Mac OS X?

前端 未结 8 620
渐次进展
渐次进展 2021-02-01 13:24

I am running docker and I want bash command completion for docker commands and parameters.

8条回答
  •  眼角桃花
    2021-02-01 13:47

    The stumbling point for me was that once you brew install bash-competion, you have to add few lines in your .bash_profile to load it once you launch Terminal:

    if [ -f $(brew --prefix)/etc/bash_completion ]; then
    . $(brew --prefix)/etc/bash_completion
    fi
    

    Source: http://davidalger.com/development/bash-completion-on-os-x-with-brew/

    Because I haven't found anywhere a step by step documentation, I've made a quick script to install homebrew, bash-completion and eventually the completion scripts for docker. https://github.com/HypnoTheNomad/docker-bash-completion-macos-brew

提交回复
热议问题