apply formatting and simplify code
This commit is contained in:
parent
a5f0a52034
commit
9c17cce4ef
30
src/_diana
30
src/_diana
|
|
@ -105,14 +105,10 @@ _diana_command_arguments() {
|
|||
_describe -t output 'Downloads to preview' GIDs
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
}
|
||||
|
||||
_diana() {
|
||||
local -a commands
|
||||
|
||||
commands=(
|
||||
_diana_subcommands() {
|
||||
local -a commands=(
|
||||
"list:Output the list of active downloads."
|
||||
"paused:Output the list of paused downloads."
|
||||
"stopped:Output the list of stopped downloads."
|
||||
|
|
@ -132,19 +128,17 @@ _diana() {
|
|||
"clean:Stop seeding completed downloads."
|
||||
)
|
||||
|
||||
_arguments -C \
|
||||
'1:cmd:->cmds' \
|
||||
'*:: :->args' \
|
||||
|
||||
case "$state" in
|
||||
(cmds)
|
||||
_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
|
||||
|
|
|
|||
Loading…
Reference in New Issue