MacOS系统配置OpenStack Client和Git命令的快速补全

1、MacOS安装Homebrew

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

2、MacOS安装bash-completion

brew install bash-completion

3、配置bash-completion

echo '[ -f /usr/local/etc/bash_completion ] && . /usr/local/etc/bash_completion' >> ~/.bash_profile

4、配置git命令的快速补全

curl -Lks https://raw.github.com/git/git/master/contrib/completion/git-completion.bash > /usr/local/etc/git-completion.bash
echo '[ -f /usr/local/etc/git-completion.bash ] && . /usr/local/etc/git-completion.bash' >> ~/.bash_profile

[/bash]

5、配置OpenStack Client的快速补全

openstack complete | sudo tee /usr/local/etc/osc.bash_completion > /dev/null
echo '[ -f /usr/local/etc/osc.bash_completion ] && . /usr/local/etc/osc.bash_completion' >> ~/.bash_profile

6、测试

[lookback@LookdeMacBook-Pro ~/OpenStack]$ . ~/.bash_profile
[lookback@LookdeMacBook-Pro ~/OpenStack]$ git co
commit   config   
[lookback@LookdeMacBook-Pro ~/OpenStack]$ openstack serv
server   service  
[lookback@LookdeMacBook-Pro ~/OpenStack]$ openstack server 
add             delete          group           lock            reboot          rescue          resize_revert   set             ssh             suspend         unrescue        
backup          dump            image           migrate         rebuild         resize          restore         shelve          start           unlock          unset           
create          event           list            pause           remove          resize_confirm  resume          show            stop            unpause         unshelve        
[lookback@LookdeMacBook-Pro ~/OpenStack]$ 

MacOS系统配置OpenStack Client和Git命令的快速补全

lookback
  • 本文由 发表于 2020年3月17日06:03:07
  • 除非特殊声明,本站文章均为原创,转载请务必保留本文链接
匿名

发表评论

匿名网友 填写信息

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: