summaryrefslogtreecommitdiff
path: root/plugins/knife/_knife
diff options
context:
space:
mode:
authorJames Smith <james@loopj.com>2012-07-24 13:39:07 -0700
committerJames Smith <james@loopj.com>2012-07-24 13:39:07 -0700
commit772bc51c3a2372592c400e0d4e159a0128989ba2 (patch)
tree191af002e272ce95418910b9c0ea63443e48e681 /plugins/knife/_knife
parent0ba398f9e1aaf05e72406d5c840f013eebb6b260 (diff)
parentd05b2010ffd4cd33ff9402c402051b1caf985d97 (diff)
downloadzsh-772bc51c3a2372592c400e0d4e159a0128989ba2.tar.gz
zsh-772bc51c3a2372592c400e0d4e159a0128989ba2.tar.bz2
zsh-772bc51c3a2372592c400e0d4e159a0128989ba2.zip
Merge
Diffstat (limited to 'plugins/knife/_knife')
-rw-r--r--plugins/knife/_knife21
1 files changed, 14 insertions, 7 deletions
diff --git a/plugins/knife/_knife b/plugins/knife/_knife
index 7f8c95ee5..8453af5be 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"
;;
@@ -138,27 +141,31 @@ _knife_options3() {
# The chef_x_remote functions use knife to get a list of objects of type x on the server
_chef_roles_remote() {
- (knife role list | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}')
+ (knife role list --format json | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}')
}
_chef_clients_remote() {
- (knife client list | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}')
+ (knife client list --format json | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}')
}
_chef_nodes_remote() {
- (knife node list | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}')
+ (knife node list --format json | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}')
}
_chef_cookbooks_remote() {
- (knife cookbook list | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}')
+ (knife cookbook list --format json | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}')
}
_chef_sitecookbooks_remote() {
- (knife cookbook site list | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}')
+ (knife cookbook site list --format json | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}')
}
_chef_data_bags_remote() {
- (knife data bag list | grep \" | awk '{print $1}' | awk -F"," '{print $1}' | awk -F"\"" '{print $2}')
+ (knife data bag list --format json | 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