Update subcommand flags

This commit is contained in:
Shohei YOSHIDA 2020-05-09 14:57:49 +09:00
parent 44e1c1ed9c
commit 1a420d3839
1 changed files with 29 additions and 12 deletions

View File

@ -114,7 +114,7 @@ _yarn_scripts() {
scripts+=("${scriptNames[$i]}:${scriptCommands[$i]}") scripts+=("${scriptNames[$i]}:${scriptCommands[$i]}")
done done
commands=($scripts $binaries) commands=('env' $scripts $binaries)
_describe 'command' commands _describe 'command' commands
} }
@ -216,6 +216,8 @@ _yarn() {
'(-O --optional)'{-O,--optional}'[install packages in optionalDependencies]' \ '(-O --optional)'{-O,--optional}'[install packages in optionalDependencies]' \
'(-E --exact)'{-E,--exact}'[install packages as exact versions]' \ '(-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]' \ '(-T --tilde)'{-T,--tilde}'[install the most recent release of the packages that have the same minor version]' \
'(--ignore-workspace-root-check -W)'{--ignore-workspace-root-check,-W}'[allows a package to be installed at the workspaces root]' \
'--audit[checks for known security issues with the installed packages]' \
'*:package-name:_yarn_add_files' '*:package-name:_yarn_add_files'
;; ;;
@ -229,13 +231,14 @@ _yarn() {
cache) cache)
_arguments \ _arguments \
'1: :(ls dir clean)' '1: :(list dir clean)' \
'*:: :->cache_args'
;; ;;
check) check)
_arguments \ _arguments \
'--integrity' \ '--integrity[Verifies that versions and hashed values of the package contents in package.json]' \
'--verify-tree' '--verify-tree[Recursively verifies that the dependencies in package.json are present in node_modules]'
;; ;;
config) config)
@ -274,12 +277,13 @@ _yarn() {
list) list)
_arguments \ _arguments \
'--depth[Limit the depth of the shown dependencies]:depth' '--depth=[Limit the depth of the shown dependencies]:depth' \
'--pattern=[filter the list of dependencies by the pattern]'
;; ;;
owner) owner)
_arguments \ _arguments \
'1: :(ls add rm)' \ '1: :(list add rm)' \
'*:: :->owner_args' '*:: :->owner_args'
;; ;;
@ -316,26 +320,33 @@ _yarn() {
tag) tag)
_arguments \ _arguments \
'1: :(ls add rm)' \ '1: :(lists add rm)' \
'*:: :->tag_args' '*:: :->tag_args'
;; ;;
team) team)
_arguments \ _arguments \
'1: :(create destroy add rm ls)' \ '1: :(create destroy add rm list)' \
'*:: :->team_args' '*:: :->team_args'
;; ;;
upgrade-interactive) upgrade-interactive)
_arguments \ _arguments \
'--latest:use the version tagged latest in the registry:' '--latest[use the version tagged latest in the registry]'
;; ;;
version) version)
_arguments \ _arguments \
'--new-version:version:' \ '--new-version[create a new version using an interactive session to prompt you]:version:' \
'--message:message:' \ '--major[creates a new version by incrementing the major version]' \
'--no-git-tag-version' '--minor[creates a new version by incrementing the minor version]' \
'--patch[creates a new version by incrementing the patch version]' \
'--premajor[creates a new prerelease version by incrementing the major version]' \
'--preminor[creates a new prerelease version by incrementing the minor version]' \
'--prepatch[creates a new prerelease version by incrementing the patch version]' \
'--prerelease[increments the prerelease version number keeping the main version]' \
'--no-git-tag-version[creates a new version without creating a git tag]' \
'--no-commit-hooks[bypasses running commit hooks when committing the new version]'
;; ;;
why) why)
@ -363,6 +374,12 @@ _yarn() {
esac esac
case $state in case $state in
cache_args)
if [[ $words[1] == "list" ]]; then
_arguments \
'--pattern=[print out every cached package that matches the pattern]:pattern:'
fi
;;
config_args) config_args)
case $words[1] in case $words[1] in
get|delete) get|delete)