apply formatting and simplify code

This commit is contained in:
Shohei YOSHIDA 2026-02-17 13:56:39 +09:00
parent a5f0a52034
commit 9c17cce4ef
No known key found for this signature in database
GPG Key ID: C9A1BB11BB940CF2
1 changed files with 38 additions and 44 deletions

View File

@ -105,14 +105,10 @@ _diana_command_arguments() {
_describe -t output 'Downloads to preview' GIDs _describe -t output 'Downloads to preview' GIDs
;; ;;
esac esac
} }
_diana() { _diana_subcommands() {
local -a commands local -a commands=(
commands=(
"list:Output the list of active downloads." "list:Output the list of active downloads."
"paused:Output the list of paused downloads." "paused:Output the list of paused downloads."
"stopped:Output the list of stopped downloads." "stopped:Output the list of stopped downloads."
@ -132,19 +128,17 @@ _diana() {
"clean:Stop seeding completed downloads." "clean:Stop seeding completed downloads."
) )
_arguments -C \
'1:cmd:->cmds' \
'*:: :->args' \
case "$state" in
(cmds)
_describe -t commands 'commands' commands _describe -t commands 'commands' commands
;;
(*)
_diana_command_arguments
;;
esac
} }
_diana _arguments \
'1:cmd:_diana_subcommands' \
'*:: :_diana_command_arguments'
# Local Variables:
# mode: Shell-Script
# sh-indentation: 2
# indent-tabs-mode: nil
# sh-basic-offset: 2
# End:
# vim: ft=zsh sw=2 ts=2 et