514ef607046e2c081de8e6c550360868cd91650f
- Author
- Christian Wolff <chrw@users.noreply.github.com>
- Committer
- Marc Cornellà <marc.cornella@live.com>
- Date
Message
Diff
This diff is truncated to protect this page.
1diff --git a/plugins/kitchen/_kitchen b/plugins/kitchen/_kitchen
2index 54105b61ac40795e4f305c757cdd4d746cd034e4..dee5c58096afa5e6d49c9c352c30aa5dad96a0d1 100644
3--- a/plugins/kitchen/_kitchen
4+++ b/plugins/kitchen/_kitchen
5@@ -1,41 +1,85 @@
6-# author: Peter Eisentraut
7-# source: https://gist.github.com/petere/10307599
8-# compdef kitchen
9+#compdef kitchen
10+# ------------------------------------------------------------------------------
11+# Copyright (c) 2014 Github zsh-users - http://github.com/zsh-users
12+# All rights reserved.
13+#
14+# Redistribution and use in source and binary forms, with or without
15+# modification, are permitted provided that the following conditions are met:
16+# * Redistributions of source code must retain the above copyright
17+# notice, this list of conditions and the following disclaimer.
18+# * Redistributions in binary form must reproduce the above copyright
19+# notice, this list of conditions and the following disclaimer in the
20+# documentation and/or other materials provided with the distribution.
21+# * Neither the name of the zsh-users nor the
22+# names of its contributors may be used to endorse or promote products
23+# derived from this software without specific prior written permission.
24+#
25+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
26+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
27+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
28+# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
29+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
30+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
31+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
32+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
33+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
34+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35+# ------------------------------------------------------------------------------
36+# Description
37+# -----------
38+#
39+# Completion script for Test Kitchen (http://kitchen.ci/).
40+#
41+# ------------------------------------------------------------------------------
42+# Authors
43+# -------
44+#
45+# * Peter Eisentraut (https://github.com/petere)
46+#
47+# ------------------------------------------------------------------------------
48+
49
50 _kitchen() {
51- local curcontext="$curcontext" state line
52- typeset -A opt_args
53-
54- _arguments '1: :->cmds'\
55- '2: :->args'
56-
57- case $state in
58- cmds)
59- _arguments "1:Commands:(console converge create destroy diagnose driver help init list login setup test verify version)"
60- ;;
61- args)
62- case $line[1] in
63- converge|create|destroy|diagnose|list|setup|test|verify)
64- compadd "$@" all
65- _kitchen_instances
66- ;;
67- login)
68- _kitchen_instances
69- ;;
70- esac
71- ;;
72- esac
73+ local curcontext="$curcontext" state line
74+ typeset -A opt_args
75+
76+ _arguments '1: :->cmds'\
77+ '2: :->args'
78+
79+ case $state in
80+ cmds)
81+ _kitchen_commands
82+ ;;
83+ args)
84+ case $line[1] in
85+ converge|create|destroy|diagnose|list|setup|test|verify)
86+ compadd 'all'
87+ _kitchen_instances
88+ ;;
89+ login)
90+ _kitchen_instances
91+ ;;
92+ esac
93+ ;;
94+ esac
95+}
96+
97+_kitchen_commands() {
98+ local commands
99+
100+ commands=("${(@f)$(_call_program commands $service help | sed -n 's/^ kitchen \([[:alpha:]]*\) [ [].*# \(.*\)$/\1:\2/p')}")
101+ _describe -t commands 'kitchen commands' commands
102 }
103
104 _kitchen_instances() {