Merge two switch-case

This commit is contained in:
Shohei YOSHIDA 2026-03-15 15:08:37 +09:00
parent 0dce3a833b
commit 96316552ea
No known key found for this signature in database
GPG Key ID: C9A1BB11BB940CF2
1 changed files with 14 additions and 9 deletions

View File

@ -50,7 +50,7 @@ function _cask() {
'*:: :->subcmds' && ret=0 '*:: :->subcmds' && ret=0
case $state in case $state in
subcommand) (subcommand)
local -a subcommands=( local -a subcommands=(
"build:build all Elisp files in the files directive" "build:build all Elisp files in the files directive"
"clean-elc:remove all byte compiled Elisp files in the files directive" "clean-elc:remove all byte compiled Elisp files in the files directive"
@ -74,17 +74,22 @@ function _cask() {
"upgrade:upgrade Cask itself and its dependencies" "upgrade:upgrade Cask itself and its dependencies"
"version:print program version" "version:print program version"
) )
_describe -t subcommands 'cask subcommands' subcommands && ret=0
esac
_describe -t subcommands 'cask subcommands' subcommands && ret=0
;;
(subcmds)
case "$words[1]" in case "$words[1]" in
init) (init)
_arguments \ _arguments \
'(--dev)--dev[Run in dev mode]' && ret=0 ;; '(--dev)--dev[Run in dev mode]' \
exec) && ret=0
;;
(exec)
_generic _generic
;; ;;
esac esac
;;
esac
return ret return ret
} }