Files
oh-my-bash/completions/test_kitchen.completion.sh
Toan Nguyen 53fb803740 OMB - Major Refactor (#39)
* 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
2019-01-23 03:05:32 -08:00

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