aboutsummaryrefslogtreecommitdiffstats
path: root/src/_knife
diff options
context:
space:
mode:
authormidchildan <git@midchildan.org>2021-11-19 00:15:06 +0900
committermidchildan <git@midchildan.org>2021-11-19 00:15:06 +0900
commitda42a24a07888ddf252e5ea9a869598ae135c626 (patch)
tree93c5ed83672f48ca25f03def6b21f1a089e8d4ac /src/_knife
parentknife: sync with oh-my-zsh (diff)
downloadzsh-completions-da42a24a07888ddf252e5ea9a869598ae135c626.tar
zsh-completions-da42a24a07888ddf252e5ea9a869598ae135c626.tar.gz
zsh-completions-da42a24a07888ddf252e5ea9a869598ae135c626.tar.bz2
zsh-completions-da42a24a07888ddf252e5ea9a869598ae135c626.tar.lz
zsh-completions-da42a24a07888ddf252e5ea9a869598ae135c626.tar.xz
zsh-completions-da42a24a07888ddf252e5ea9a869598ae135c626.tar.zst
zsh-completions-da42a24a07888ddf252e5ea9a869598ae135c626.zip
knife: backport #531 and #131
Diffstat (limited to 'src/_knife')
-rw-r--r--src/_knife11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/_knife b/src/_knife
index a4fbbca..55770b0 100644
--- a/src/_knife
+++ b/src/_knife
@@ -72,7 +72,7 @@ _knife() {
case $state in
knifecmd)
- compadd -Q "$@" bootstrap client configure cookbook "cookbook site" "data bag" diff exec environment index node recipe role search solo ssh status upload vault windows $cloudproviders
+ compadd -Q "$@" bootstrap client configure cookbook "cookbook site" "data bag" diff exec environment user index node recipe role search solo ssh status upload vault windows $cloudproviders
;;
knifesubcmd)
case $words[2] in
@@ -94,6 +94,9 @@ _knife() {
environment)
compadd -Q "$@" list create delete edit show "from file"
;;
+ user)
+ compadd -Q "$@" create delete edit list reregister show
+ ;;
node)
compadd -Q "$@" "from file" create show edit delete list run_list "bulk delete"
;;
@@ -263,6 +266,10 @@ _chef_environments_remote() {
(knife environment list | awk '{print $1}')
}
+_chef_users_remote() {
+ (knife user 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() {
if [ $KNIFE_RELATIVE_PATH ]; then
@@ -272,7 +279,7 @@ _chef_cookbooks_local() {
if [ -f ./.chef/knife.rb ]; then
knife_rb="./.chef/knife.rb"
fi
- local cookbook_path=${KNIFE_COOKBOOK_PATH:-$(grep cookbook_path $knife_rb | awk 'BEGIN {FS = "[" }; {print $2}' | sed 's/\,//g' | sed "s/'//g" | sed 's/\(.*\)]/\1/')}
+ local cookbook_path=${KNIFE_COOKBOOK_PATH:-$(grep cookbook_path $knife_rb | awk 'BEGIN {FS = "[" }; {print $2}' | sed 's/\,//g' | sed "s/'//g" | sed 's/\(.*\)]/\1/' | cut -d '"' -f2)}
fi
(for i in $cookbook_path; do ls $i; done)
}