2b379ec42c8675d6076737e1373767c160f5ae70

Author
Brian Tannous <brian@briantannous.com>
Committer
GitHub <noreply@github.com>
Date

Message

feat(kn): add plugin for `kn` completion (#8927)

Diff

 1diff --git a/plugins/kn/README.md b/plugins/kn/README.md
 2new file mode 100644
 3index 0000000000000000000000000000000000000000..d2eb9b31d29867c931e5d8f2c317975e0a95888c
 4--- /dev/null
 5+++ b/plugins/kn/README.md
 6@@ -0,0 +1,17 @@
 7+# kn - Knative CLI
 8+
 9+This plugin provides autocompletion for [kn](https://knative.dev/docs/install/client/install-kn/) operations.
10+
11+To use it, add `kn` to the plugins array of your zshrc file:
12+
13+```zsh
14+plugins=(... kn)
15+```
16+
17+## See Also
18+
19++ [kn/client](https://github.com/knative/client)
20+
21+## Contributors
22+
23++ [btannous](https://github.com/btannous) - Plugin Author
24diff --git a/plugins/kn/kn.plugin.zsh b/plugins/kn/kn.plugin.zsh
25new file mode 100644
26index 0000000000000000000000000000000000000000..f60177dd9eb444ca0a16eb884044a3b6f8f46ebe
27--- /dev/null
28+++ b/plugins/kn/kn.plugin.zsh
29@@ -0,0 +1,8 @@
30+# Autocompletion for kn, the command line interface for knative
31+#
32+# Author: https://github.com/btannous
33+
34+if [ $commands[kn] ]; then
35+  source <(kn completion zsh)
36+  compdef _kn kn 
37+fi