From 78d8744642633f8e031ec87dfc9f336eeea96e99 Mon Sep 17 00:00:00 2001 From: Shohei YOSHIDA Date: Wed, 25 Mar 2020 00:05:14 +0900 Subject: [PATCH] Complete local file 'yarn add' Complete local file if 'file:' or 'link:' is specified --- src/_yarn | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/_yarn b/src/_yarn index 70e783b..e302cf3 100644 --- a/src/_yarn +++ b/src/_yarn @@ -32,6 +32,7 @@ # ------- # # * Massimiliano Torromeo +# * Shohei YOSHIDA # # ------------------------------------------------------------------------------ @@ -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)