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

前端 未结 8 417
渐次进展
渐次进展 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:40

    Guide to setup autocomplete for ZSH on Mac OSX

    Follow these steps if you are using oh-my-zsh and autocomplete is not working:

    Step 1:

    Make the following three links:

    ln -s /Applications/Docker.app/Contents/Resources/etc/docker.zsh-completion /usr/local/share/zsh/site-functions/_docker

    ln -s /Applications/Docker.app/Contents/Resources/etc/docker-compose.zsh-completion /usr/local/share/zsh/site-functions/_docker-compose

    Step 2:

    Either add autoload -Uz compinit; compinit to .zshrc

    or run echo "autoload -Uz compinit; compinit" >> .zshrc in your shell

提交回复
热议问题