initial support for chef 11 integrated knife-essentials
* added new commands 'diff' and 'upload'
* Add basic file completion for file-centric commands 'diff' and
'upload'
Diff
1diff --git a/plugins/knife/_knife b/plugins/knife/_knife
2index 9f5b406afd771334308490a6b5871163ae8f0ea4..b44283f78fd435f976c052d5c535259c6284e3e3 100644
3--- a/plugins/knife/_knife
4+++ b/plugins/knife/_knife
5@@ -31,7 +31,7 @@ _knife() {
6 7 case $state in
8 knifecmd)
9- compadd -Q "$@" bootstrap client configure cookbook "cookbook site" "data bag" exec environment index node recipe role search ssh status windows $cloudproviders
10+ compadd -Q "$@" bootstrap client configure cookbook "cookbook site" "data bag" diff exec environment index node recipe role search ssh status upload windows $cloudproviders
11 ;;
12 knifesubcmd)
13 case $words[2] in
14@@ -47,9 +47,12 @@ _knife() {
15 cookbook)
16 compadd -Q "$@" test list create download delete "metadata from" show "bulk delete" metadata upload
17 ;;
18- environment)
19+ diff)
20+ _arguments '*:file or directory:_files -g "*"'
21+ ;;
22+ environment)
23 compadd -Q "$@" list create delete edit show "from file"
24- ;;
25+ ;;
26 node)
27 compadd -Q "$@" "from file" create show edit delete list run_list "bulk delete"
28 ;;
29@@ -59,6 +62,9 @@ _knife() {
30 role)
31 compadd -Q "$@" "bulk delete" create delete edit "from file" list show
32 ;;
33+ upload)
34+ _arguments '*:file or directory:_files -g "*"'
35+ ;;
36 windows)
37 compadd "$@" bootstrap
38 ;;