Cleanup code

This commit is contained in:
Shohei YOSHIDA
2024-08-04 14:19:29 +09:00
parent 8abb801db2
commit 4dfb7a51c5
11 changed files with 174 additions and 163 deletions
+27 -20
View File
@@ -39,30 +39,37 @@
# ------------------------------------------------------------------------------
_dad() {
local -a commands
typeset -A opt_args
local context state line
local curcontext="$curcontext"
commands=(
"start:Start aria2c daemon"
"stop:Stop aria2c daemon"
)
local -a commands=(
"start:Start aria2c daemon"
"stop:Stop aria2c daemon"
)
_arguments -C \
'(- 1 *)'-h"[Show help and exit]" \
"-d[Set download dir]:download_dir:->val" \
"-s[Set secret token]:secret_token:->val" \
"-u[Set aria2c username]:username:->val" \
"-p[Set aria2c password]:password:->val" \
'1:cmd:->cmds' \
'*: : :->args' \
_arguments -C \
'(- 1 *)'-h"[Show help and exit]" \
"-d[Set download dir]:download_dir:->val" \
"-s[Set secret token]:secret_token:->val" \
"-u[Set aria2c username]:username:->val" \
"-p[Set aria2c password]:password:->val" \
'1:cmd:->cmds' \
'*: : :->args'
case "$state" in
(cmds)
_describe -t commands 'commands' commands
;;
(*)
;;
esac
case "$state" in
(cmds)
_describe -t commands 'commands' commands
;;
esac
}
_dad
# 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