docker for mac 设置命令自动补全

配置命令自动补全

如果安装了Homebrew的话,可以按照如下设置docker相关的命令自动补全:

cd /usr/local/etc/bash_completion.d
ln -s /Applications/Docker.app/Contents/Resources/etc/docker.bash-completion
ln -s /Applications/Docker.app/Contents/Resources/etc/docker-machine.bash-completion
ln -s /Applications/Docker.app/Contents/Resources/etc/docker-compose.bash-completion
  • 1
  • 2
  • 3
  • 4

注:如何设置命令自动补全:

$ brew install bash-completion
$ brew tap homebrew/completions
  • 1
  • 2

运行完第一条命令后, 按照brew的风格, 他会提示你添加下面的片段到你的 ~/.bash_profile中。不要忘记操作这一步!

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

要发表评论,您必须先登录