From 7a2db2fe49de2aec448931674f624c54cff3d3a9 Mon Sep 17 00:00:00 2001 From: Mikael Magnusson Date: Sun, 3 May 2026 04:14:32 +0200 Subject: [PATCH] _yarn: return values and _wanted --- src/_yarn | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/_yarn b/src/_yarn index c29927c..2b9b22f 100644 --- a/src/_yarn +++ b/src/_yarn @@ -345,7 +345,8 @@ _yarn_cache() { _arguments \ '(- *)'{-h,--help}'[show help message and exit]' \ '--mirror[remove the global cache files instead of the local cache files]' \ - '--all[remove both the global cache files and the local cache files of the current project]' + '--all[remove both the global cache files and the local cache files of the current project]' \ + && ret=0 ;; esac ;; @@ -640,8 +641,6 @@ _yarn_plugin_subcommands() { (( $+functions[_yarn_run] )) || _yarn_run() { - local ret=1 - _arguments \ '(- *)'{-h,--help}'[show help message and exit]' \ '--json[format the output as an NDJSON stream]' \ @@ -651,10 +650,7 @@ _yarn_run() { '(-B --binaries-only)'{-B,--binaries-only}'[ignore any user defined scripts and only check binaries]' \ '*--require[preload given module]:module' \ '1: :_yarn_scripts' \ - '*:: :_files' \ - && ret=0 - - return ret + '*:: :_files' } (( $+functions[_yarn_set] )) || @@ -908,7 +904,7 @@ _yarn_scripts() { fi local -a candidates=($scripts $binaries) - compadd -a candidates + _wanted candidates expl 'scripts' compadd -a candidates } _yarn "$@"