Skip to content

Commit

Permalink
Merge pull request ohmyzsh#757 from cwjohnston/knife-environments
Browse files Browse the repository at this point in the history
Add support for chef environments in knife plugin
  • Loading branch information
robbyrussell committed Dec 19, 2011
2 parents 8ca8d26 + 1ced49b commit 8c96fa3
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion plugins/knife/_knife
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
;;
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 8c96fa3

Please sign in to comment.