vagrantを頻繁にupしたりdestroyしたりbox addとかbox removeとかなんやかんやしていると毎度毎度コマンドをフルで実行するのが面倒になってくる。
ということで、導入した。
https://github.com/kura/vagrant-bash-completion
こちらのREADMEの通りに実行する。
※homebrewのインストールは割愛
$ brew tap homebrew/completions
Cloning into '/usr/local/Library/Taps/homebrew/homebrew-completions'...
remote: Reusing existing pack: 72, done.
remote: Total 72 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (72/72), done.
Checking connectivity... done.
Tapped 11 formulae
$ brew install vagrant-completion
==> Downloading https://raw.githubusercontent.com/mitchellh/vagrant/v1.6.2/contrib/bash/completion.sh
######################################################################## 100.0%
==> Caveats
Bash completion has been installed to:
/usr/local/etc/bash_completion.d
==> Summary
? /usr/local/Cellar/vagrant-completion/1.6.2: 2 files, 12K, built in 2 seconds
インストール実行後は、.bashrcか.bash_profileに下記を記載する。
$ vim .bash_profile
if [ -f `brew --prefix`/etc/bash_completion.d/vagrant ]; then
source `brew --prefix`/etc/bash_completion.d/vagrant
fi
$ source $HOME/.bash_profile
これでvagrant のあとのコマンドがタブ補完で出てくるのでだいぶ楽になった。