From 96316552eafcb902d5185297e812d0705a78b485 Mon Sep 17 00:00:00 2001 From: Shohei YOSHIDA Date: Sun, 15 Mar 2026 15:08:37 +0900 Subject: [PATCH] Merge two switch-case --- src/_cask | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/src/_cask b/src/_cask index 89c4e73..13102a0 100644 --- a/src/_cask +++ b/src/_cask @@ -50,7 +50,7 @@ function _cask() { '*:: :->subcmds' && ret=0 case $state in - subcommand) + (subcommand) local -a subcommands=( "build:build all Elisp files in the files directive" "clean-elc:remove all byte compiled Elisp files in the files directive" @@ -74,15 +74,20 @@ function _cask() { "upgrade:upgrade Cask itself and its dependencies" "version:print program version" ) - _describe -t subcommands 'cask subcommands' subcommands && ret=0 - esac - case "$words[1]" in - init) - _arguments \ - '(--dev)--dev[Run in dev mode]' && ret=0 ;; - exec) - _generic + _describe -t subcommands 'cask subcommands' subcommands && ret=0 + ;; + (subcmds) + case "$words[1]" in + (init) + _arguments \ + '(--dev)--dev[Run in dev mode]' \ + && ret=0 + ;; + (exec) + _generic + ;; + esac ;; esac