summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorRobby Russell <robby@planetargon.com>2011-12-19 13:55:40 -0800
committerRobby Russell <robby@planetargon.com>2011-12-19 13:55:40 -0800
commit8c96fa3ec681f476c5ca8b1a4655dcb71c9baa91 (patch)
tree3f5e5d69cc526a2bbe2f2c523c9e236721479ae9 /plugins
parent8ca8d2661c2d65bed85a5d7e64bcc2038c4a5218 (diff)
parent1ced49b85a859b399728ce32ef77399874f5172b (diff)
downloadzsh-8c96fa3ec681f476c5ca8b1a4655dcb71c9baa91.tar.gz
zsh-8c96fa3ec681f476c5ca8b1a4655dcb71c9baa91.tar.bz2
zsh-8c96fa3ec681f476c5ca8b1a4655dcb71c9baa91.zip
Merge pull request #757 from cwjohnston/knife-environments
Add support for chef environments in knife plugin
Diffstat (limited to 'plugins')
-rw-r--r--plugins/knife/_knife9
1 files changed, 8 insertions, 1 deletions
diff --git a/plugins/knife/_knife b/plugins/knife/_knife
index 7f8c95ee5..32ff9fc99 100644
--- a/plugins/knife/_knife
+++ b/plugins/knife/_knife
@@ -26,7 +26,7 @@ _knife() {
case $state in
knifecmd)
- compadd -Q "$@" bootstrap client configure cookbook "cookbook site" "data bag" exec index node recipe role search ssh status windows $cloudproviders
+ compadd -Q "$@" bootstrap client configure cookbook "cookbook site" "data bag" exec environment index node recipe role search ssh status windows $cloudproviders
;;
knifesubcmd)
case $words[2] in
@@ -42,6 +42,9 @@ _knife() {
cookbook)
compadd -Q "$@" test list create download delete "metadata from" show "bulk delete" metadata upload
;;
+ environment)
+ compadd -Q "$@" list create delete edit show "from file"
+ ;;
node)
compadd -Q "$@" "from file" create show edit delete list run_list "bulk delete"
;;
@@ -161,6 +164,10 @@ _chef_data_bags_remote() {
(knife data bag list | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}')
}
+_chef_environments_remote() {
+ (knife environment list | awk '{print $1}')
+}
+
# The chef_x_local functions use the knife config to find the paths of relevant objects x to be uploaded to the server
_chef_cookbooks_local() {
(for i in $( grep cookbook_path $HOME/.chef/knife.rb | awk 'BEGIN {FS = "[" }; {print $2}' | sed 's/\,//g' | sed "s/'//g" | sed 's/\(.*\)]/\1/' ); do ls $i; done)