Update subcommand completion
This commit is contained in:
parent
195bdb40c7
commit
4601310ac2
44
src/_yarn
44
src/_yarn
|
@ -38,10 +38,13 @@
|
||||||
|
|
||||||
_commands=(
|
_commands=(
|
||||||
'access'
|
'access'
|
||||||
|
'audit:Checks for known security issues with the installed packages'
|
||||||
'autoclean:Clean and remove unnecessary files from package dependencies'
|
'autoclean:Clean and remove unnecessary files from package dependencies'
|
||||||
'cache:List or clean every cached package'
|
'cache:List or clean every cached package'
|
||||||
"check:Verify package dependencies against yarn's lock file"
|
"check:Verify package dependencies against yarn's lock file"
|
||||||
'config:Manages the yarn configuration files'
|
'config:Manages the yarn configuration files'
|
||||||
|
'create:Creates new projects from any create-* starter kits'
|
||||||
|
'exec'
|
||||||
'generate-lock-entry:Generates a lock file entry'
|
'generate-lock-entry:Generates a lock file entry'
|
||||||
'global:Install packages globally on your operating system'
|
'global:Install packages globally on your operating system'
|
||||||
'help:Show information about a command'
|
'help:Show information about a command'
|
||||||
|
@ -51,25 +54,30 @@ _commands=(
|
||||||
'install:Install all the dependencies listed within package.json'
|
'install:Install all the dependencies listed within package.json'
|
||||||
'licenses:List licenses for installed packages'
|
'licenses:List licenses for installed packages'
|
||||||
'link:Symlink a package folder during development'
|
'link:Symlink a package folder during development'
|
||||||
'list:List installed packages'
|
|
||||||
'login:Store registry username and email'
|
'login:Store registry username and email'
|
||||||
'logout:Clear registry username and email'
|
'logout:Clear registry username and email'
|
||||||
|
'node:Runs Node with the same version that the one used by Yarn itself'
|
||||||
'outdated:Check for outdated package dependencies'
|
'outdated:Check for outdated package dependencies'
|
||||||
'owner:Manage package owners'
|
'owner:Manage package owners'
|
||||||
'pack:Create a compressed gzip archive of package dependencies'
|
'pack:Create a compressed gzip archive of package dependencies'
|
||||||
|
'policies:Defines project-wide policies for your project'
|
||||||
'publish:Publish a package to the npm registry'
|
'publish:Publish a package to the npm registry'
|
||||||
'run:Run a defined package script'
|
'run:Run a defined package script'
|
||||||
'tag:Add, remove, or list tags on a package'
|
'tag:Add, remove, or list tags on a package'
|
||||||
'team:Maintain team memberships'
|
'team:Maintain team memberships'
|
||||||
'unlink:Unlink a previously created symlink for a package'
|
'unlink:Unlink a previously created symlink for a package'
|
||||||
|
'unplug:Temporarily copies a package outside of the global cache for debugging purposes'
|
||||||
'version:Update the package version'
|
'version:Update the package version'
|
||||||
'versions:Display version information of currently installed Yarn, Node.js, and its dependencies'
|
'versions:Display version information of currently installed Yarn, Node.js, and its dependencies'
|
||||||
'why:Show information about why a package is installed'
|
'why:Show information about why a package is installed'
|
||||||
|
'workspace'
|
||||||
|
'workspaces:Show information about your workspaces'
|
||||||
)
|
)
|
||||||
|
|
||||||
_global_commands=(
|
_global_commands=(
|
||||||
'add:Installs a package and any packages that it depends on'
|
'add:Installs a package and any packages that it depends on'
|
||||||
'bin:Displays the location of the yarn bin folder'
|
'bin:Displays the location of the yarn bin folder'
|
||||||
|
'list:List installed packages'
|
||||||
'remove:Remove installed package from dependencies updating package.json'
|
'remove:Remove installed package from dependencies updating package.json'
|
||||||
'upgrade:Upgrades packages to their latest version based on the specified range'
|
'upgrade:Upgrades packages to their latest version based on the specified range'
|
||||||
'upgrade-interactive:Interactively upgrade packages'
|
'upgrade-interactive:Interactively upgrade packages'
|
||||||
|
@ -117,6 +125,11 @@ _yarn_add_files() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_yarn_workspaces() {
|
||||||
|
local -a workspaces=(${(@f)$(yarn workspaces info |sed -n -r -e 's/^ "([^"]+)": \{/\1/p')})
|
||||||
|
_describe 'workspace' workspaces
|
||||||
|
}
|
||||||
|
|
||||||
_yarn() {
|
_yarn() {
|
||||||
local context state state_descr line
|
local context state state_descr line
|
||||||
typeset -A opt_args
|
typeset -A opt_args
|
||||||
|
@ -197,6 +210,14 @@ _yarn() {
|
||||||
'*:package-name:_yarn_add_files'
|
'*:package-name:_yarn_add_files'
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
audit)
|
||||||
|
_arguments \
|
||||||
|
'--verbose[output verbose message]' \
|
||||||
|
'--json[format Yarn log messages as lines of JSON]' \
|
||||||
|
'--level=[only print advisories with severity greater than or equal to]:level:(info low moderate high critical)' \
|
||||||
|
'--groups=[only audit dependencies from listed groups]:groups:->groups_args'
|
||||||
|
;;
|
||||||
|
|
||||||
cache)
|
cache)
|
||||||
_arguments \
|
_arguments \
|
||||||
'1: :(ls dir clean)'
|
'1: :(ls dir clean)'
|
||||||
|
@ -268,6 +289,11 @@ _yarn() {
|
||||||
'1: :_files'
|
'1: :_files'
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
policies)
|
||||||
|
_arguments \
|
||||||
|
'1: :(set-version)'
|
||||||
|
;;
|
||||||
|
|
||||||
remove|upgrade)
|
remove|upgrade)
|
||||||
_arguments \
|
_arguments \
|
||||||
'*:package:'
|
'*:package:'
|
||||||
|
@ -308,6 +334,18 @@ _yarn() {
|
||||||
'1:query:_files'
|
'1:query:_files'
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
workspace)
|
||||||
|
_arguments \
|
||||||
|
'1:workspace:_yarn_workspaces' \
|
||||||
|
'*:: :_yarn_global_commands'
|
||||||
|
;;
|
||||||
|
|
||||||
|
workspaces)
|
||||||
|
_arguments \
|
||||||
|
'--json[format Yarn log messages as lines of JSON]' \
|
||||||
|
'1:commands:(info run)'
|
||||||
|
;;
|
||||||
|
|
||||||
*)
|
*)
|
||||||
_default
|
_default
|
||||||
;;
|
;;
|
||||||
|
@ -331,6 +369,10 @@ _yarn() {
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
|
groups_args)
|
||||||
|
local dependency_groups=(devDependencies dependencies optionalDependencies peerDependencies bundledDependencies)
|
||||||
|
_values -s ',' 'groups' $dependency_groups
|
||||||
|
;;
|
||||||
|
|
||||||
owner_args)
|
owner_args)
|
||||||
case $words[1] in
|
case $words[1] in
|
||||||
|
|
Loading…
Reference in New Issue