mirror of
https://github.com/ohmybash/oh-my-bash.git
synced 2024-05-11 05:55:37 +00:00
* OMB - Major Refactor - Aliases and completions now works like plugins (need to enabled in .bashrc) - Removed the compatible check in spectrum.sh, OMB now works with Bash v3.x like the old days. - Removed core plugin, added those bash functions into base.sh and load during startup. - Updated OSH template for new installations - Added history config and few other stuff from #17 @TODO: Added a shell script to update old version of .bashrc to new one. * Fixed ShellCheck issues * Fixed ShellCheck issues
32 lines
878 B
Bash
32 lines
878 B
Bash
__kitchen_instance_list () {
|
|
# cache to .kitchen.list.yml
|
|
if [[ .kitchen.yml -nt .kitchen.list.yml || .kitchen.local.yml -nt .kitchen.list.yml ]]; then
|
|
# update list if config has updated
|
|
kitchen list --bare > .kitchen.list.yml
|
|
fi
|
|
cat .kitchen.list.yml
|
|
}
|
|
|
|
__kitchen_options () {
|
|
cur="${COMP_WORDS[COMP_CWORD]}"
|
|
prev="${COMP_WORDS[COMP_CWORD-1]}"
|
|
COMPREPLY=()
|
|
|
|
case $prev in
|
|
converge|create|destroy|diagnose|list|login|setup|test|verify)
|
|
COMPREPLY=( $(compgen -W "$(__kitchen_instance_list)" -- ${cur} ))
|
|
return 0
|
|
;;
|
|
driver)
|
|
COMPREPLY=( $(compgen -W "create discover help" -- ${cur} ))
|
|
return 0
|
|
;;
|
|
*)
|
|
COMPREPLY=( $(compgen -W "console converge create destroy driver help init list login setup test verify version" -- ${cur} ))
|
|
return 0
|
|
;;
|
|
esac
|
|
}
|
|
complete -F __kitchen_options kitchen
|
|
|