aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShohei YOSHIDA <syohex@gmail.com>2020-03-25 08:16:42 +0900
committerGitHub <noreply@github.com>2020-03-25 08:16:42 +0900
commitbf24777aa1ed2fe72145545924fb305a81480664 (patch)
tree496e8298d4e34275c76bacd561f0ffb422d2ccf7
parentMerge pull request #692 from syohex/syohex/update-kitchen (diff)
parentComplete local file 'yarn add' (diff)
downloadzsh-completions-bf24777aa1ed2fe72145545924fb305a81480664.tar
zsh-completions-bf24777aa1ed2fe72145545924fb305a81480664.tar.gz
zsh-completions-bf24777aa1ed2fe72145545924fb305a81480664.tar.bz2
zsh-completions-bf24777aa1ed2fe72145545924fb305a81480664.tar.lz
zsh-completions-bf24777aa1ed2fe72145545924fb305a81480664.tar.xz
zsh-completions-bf24777aa1ed2fe72145545924fb305a81480664.tar.zst
zsh-completions-bf24777aa1ed2fe72145545924fb305a81480664.zip
Merge pull request #694 from syohex/syohex/yarn-add-file-completion
Complete local file 'yarn add'
-rw-r--r--src/_yarn9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/_yarn b/src/_yarn
index 70e783b..e302cf3 100644
--- a/src/_yarn
+++ b/src/_yarn
@@ -32,6 +32,7 @@
# -------
#
# * Massimiliano Torromeo <massimiliano.torromeo@gmail.com>
+# * Shohei YOSHIDA <syohex@gmail.com>
#
# ------------------------------------------------------------------------------
@@ -110,6 +111,12 @@ _yarn_commands() {
_describe 'command' _commands -- _global_commands
}
+_yarn_add_files() {
+ if compset -P "(file|link):"; then
+ _files
+ fi
+}
+
_yarn() {
local context state state_descr line
typeset -A opt_args
@@ -173,7 +180,7 @@ _yarn() {
'(-O --optional)'{-O,--optional}'[install packages in optionalDependencies]' \
'(-E --exact)'{-E,--exact}'[install packages as exact versions]' \
'(-T --tilde)'{-T,--tilde}'[install the most recent release of the packages that have the same minor version]' \
- '*:package-name:'
+ '*:package-name:_yarn_add_files'
;;
cache)