mirror of
https://github.com/traxys/Nixfiles.git
synced 2026-02-13 19:00:19 +01:00
555 lines
15 KiB
Text
555 lines
15 KiB
Text
#compdef kabalist_cli
|
|
|
|
autoload -U is-at-least
|
|
|
|
_kabalist_cli() {
|
|
typeset -A opt_args
|
|
typeset -a _arguments_options
|
|
local ret=1
|
|
|
|
if is-at-least 5.2; then
|
|
_arguments_options=(-s -S -C)
|
|
else
|
|
_arguments_options=(-s -C)
|
|
fi
|
|
|
|
local context curcontext="$curcontext" state line
|
|
_arguments "${_arguments_options[@]}" \
|
|
'-u+[]:URL: ' \
|
|
'--url=[]:URL: ' \
|
|
'-h[Print help information]' \
|
|
'--help[Print help information]' \
|
|
":: :_kabalist_cli_commands" \
|
|
"*::: :->kabalist_cli" \
|
|
&& ret=0
|
|
case $state in
|
|
(kabalist_cli)
|
|
words=($line[1] "${words[@]}")
|
|
(( CURRENT += 1 ))
|
|
curcontext="${curcontext%:*:*}:kabalist_cli-command-$line[1]:"
|
|
case $line[1] in
|
|
(account)
|
|
_arguments "${_arguments_options[@]}" \
|
|
'-h[Print help information]' \
|
|
'--help[Print help information]' \
|
|
":: :_kabalist_cli__account_commands" \
|
|
"*::: :->account" \
|
|
&& ret=0
|
|
|
|
case $state in
|
|
(account)
|
|
words=($line[1] "${words[@]}")
|
|
(( CURRENT += 1 ))
|
|
curcontext="${curcontext%:*:*}:kabalist_cli-account-command-$line[1]:"
|
|
case $line[1] in
|
|
(login)
|
|
_arguments "${_arguments_options[@]}" \
|
|
'-h[Print help information]' \
|
|
'--help[Print help information]' \
|
|
':name:' \
|
|
'::password:' \
|
|
&& ret=0
|
|
;;
|
|
(recover)
|
|
_arguments "${_arguments_options[@]}" \
|
|
'-h[Print help information]' \
|
|
'--help[Print help information]' \
|
|
':id:' \
|
|
'::password:' \
|
|
&& ret=0
|
|
;;
|
|
(register)
|
|
_arguments "${_arguments_options[@]}" \
|
|
'-h[Print help information]' \
|
|
'--help[Print help information]' \
|
|
':id:' \
|
|
':username:' \
|
|
'::password:' \
|
|
&& ret=0
|
|
;;
|
|
(help)
|
|
_arguments "${_arguments_options[@]}" \
|
|
'*::subcommand -- The subcommand whose help message to display:' \
|
|
&& ret=0
|
|
;;
|
|
esac
|
|
;;
|
|
esac
|
|
;;
|
|
(list)
|
|
_arguments "${_arguments_options[@]}" \
|
|
'-t+[]:TOKEN: ' \
|
|
'--token=[]:TOKEN: ' \
|
|
'-h[Print help information]' \
|
|
'--help[Print help information]' \
|
|
':list:' \
|
|
":: :_kabalist_cli__list_commands" \
|
|
"*::: :->list" \
|
|
&& ret=0
|
|
|
|
case $state in
|
|
(list)
|
|
words=($line[2] "${words[@]}")
|
|
(( CURRENT += 1 ))
|
|
curcontext="${curcontext%:*:*}:kabalist_cli-list-command-$line[2]:"
|
|
case $line[2] in
|
|
(delete)
|
|
_arguments "${_arguments_options[@]}" \
|
|
'-h[Print help information]' \
|
|
'--help[Print help information]' \
|
|
&& ret=0
|
|
;;
|
|
(add)
|
|
_arguments "${_arguments_options[@]}" \
|
|
'-h[Print help information]' \
|
|
'--help[Print help information]' \
|
|
':name:' \
|
|
'::amount:' \
|
|
&& ret=0
|
|
;;
|
|
(item)
|
|
_arguments "${_arguments_options[@]}" \
|
|
'-h[Print help information]' \
|
|
'--help[Print help information]' \
|
|
':item:' \
|
|
":: :_kabalist_cli__list__item_commands" \
|
|
"*::: :->item" \
|
|
&& ret=0
|
|
|
|
case $state in
|
|
(item)
|
|
words=($line[2] "${words[@]}")
|
|
(( CURRENT += 1 ))
|
|
curcontext="${curcontext%:*:*}:kabalist_cli-list-item-command-$line[2]:"
|
|
case $line[2] in
|
|
(tick)
|
|
_arguments "${_arguments_options[@]}" \
|
|
'-h[Print help information]' \
|
|
'--help[Print help information]' \
|
|
&& ret=0
|
|
;;
|
|
(update)
|
|
_arguments "${_arguments_options[@]}" \
|
|
'-h[Print help information]' \
|
|
'--help[Print help information]' \
|
|
'::name:' \
|
|
'::amount:' \
|
|
&& ret=0
|
|
;;
|
|
(help)
|
|
_arguments "${_arguments_options[@]}" \
|
|
'*::subcommand -- The subcommand whose help message to display:' \
|
|
&& ret=0
|
|
;;
|
|
esac
|
|
;;
|
|
esac
|
|
;;
|
|
(share)
|
|
_arguments "${_arguments_options[@]}" \
|
|
'-h[Print help information]' \
|
|
'--help[Print help information]' \
|
|
":: :_kabalist_cli__list__share_commands" \
|
|
"*::: :->share" \
|
|
&& ret=0
|
|
|
|
case $state in
|
|
(share)
|
|
words=($line[1] "${words[@]}")
|
|
(( CURRENT += 1 ))
|
|
curcontext="${curcontext%:*:*}:kabalist_cli-list-share-command-$line[1]:"
|
|
case $line[1] in
|
|
(add)
|
|
_arguments "${_arguments_options[@]}" \
|
|
'-r[]' \
|
|
'--readonly[]' \
|
|
'-h[Print help information]' \
|
|
'--help[Print help information]' \
|
|
':name:' \
|
|
&& ret=0
|
|
;;
|
|
(delete)
|
|
_arguments "${_arguments_options[@]}" \
|
|
'--all[]' \
|
|
'-h[Print help information]' \
|
|
'--help[Print help information]' \
|
|
'*::names:' \
|
|
&& ret=0
|
|
;;
|
|
(help)
|
|
_arguments "${_arguments_options[@]}" \
|
|
'*::subcommand -- The subcommand whose help message to display:' \
|
|
&& ret=0
|
|
;;
|
|
esac
|
|
;;
|
|
esac
|
|
;;
|
|
(public)
|
|
_arguments "${_arguments_options[@]}" \
|
|
'-h[Print help information]' \
|
|
'--help[Print help information]' \
|
|
":: :_kabalist_cli__list__public_commands" \
|
|
"*::: :->public" \
|
|
&& ret=0
|
|
|
|
case $state in
|
|
(public)
|
|
words=($line[1] "${words[@]}")
|
|
(( CURRENT += 1 ))
|
|
curcontext="${curcontext%:*:*}:kabalist_cli-list-public-command-$line[1]:"
|
|
case $line[1] in
|
|
(set)
|
|
_arguments "${_arguments_options[@]}" \
|
|
'-h[Print help information]' \
|
|
'--help[Print help information]' \
|
|
&& ret=0
|
|
;;
|
|
(remove)
|
|
_arguments "${_arguments_options[@]}" \
|
|
'-h[Print help information]' \
|
|
'--help[Print help information]' \
|
|
&& ret=0
|
|
;;
|
|
(help)
|
|
_arguments "${_arguments_options[@]}" \
|
|
'*::subcommand -- The subcommand whose help message to display:' \
|
|
&& ret=0
|
|
;;
|
|
esac
|
|
;;
|
|
esac
|
|
;;
|
|
(history)
|
|
_arguments "${_arguments_options[@]}" \
|
|
'-h[Print help information]' \
|
|
'--help[Print help information]' \
|
|
'::search:' \
|
|
&& ret=0
|
|
;;
|
|
(pantry)
|
|
_arguments "${_arguments_options[@]}" \
|
|
'-h[Print help information]' \
|
|
'--help[Print help information]' \
|
|
":: :_kabalist_cli__list__pantry_commands" \
|
|
"*::: :->pantry" \
|
|
&& ret=0
|
|
|
|
case $state in
|
|
(pantry)
|
|
words=($line[1] "${words[@]}")
|
|
(( CURRENT += 1 ))
|
|
curcontext="${curcontext%:*:*}:kabalist_cli-list-pantry-command-$line[1]:"
|
|
case $line[1] in
|
|
(add)
|
|
_arguments "${_arguments_options[@]}" \
|
|
'-h[Print help information]' \
|
|
'--help[Print help information]' \
|
|
':name:' \
|
|
':target:' \
|
|
&& ret=0
|
|
;;
|
|
(edit)
|
|
_arguments "${_arguments_options[@]}" \
|
|
'-t+[]:TARGET: ' \
|
|
'--target=[]:TARGET: ' \
|
|
'-a+[]:AMOUNT: ' \
|
|
'--amount=[]:AMOUNT: ' \
|
|
'-h[Print help information]' \
|
|
'--help[Print help information]' \
|
|
':item:' \
|
|
&& ret=0
|
|
;;
|
|
(delete)
|
|
_arguments "${_arguments_options[@]}" \
|
|
'-h[Print help information]' \
|
|
'--help[Print help information]' \
|
|
':item:' \
|
|
&& ret=0
|
|
;;
|
|
(refill)
|
|
_arguments "${_arguments_options[@]}" \
|
|
'-h[Print help information]' \
|
|
'--help[Print help information]' \
|
|
&& ret=0
|
|
;;
|
|
(help)
|
|
_arguments "${_arguments_options[@]}" \
|
|
'*::subcommand -- The subcommand whose help message to display:' \
|
|
&& ret=0
|
|
;;
|
|
esac
|
|
;;
|
|
esac
|
|
;;
|
|
(help)
|
|
_arguments "${_arguments_options[@]}" \
|
|
'*::subcommand -- The subcommand whose help message to display:' \
|
|
&& ret=0
|
|
;;
|
|
esac
|
|
;;
|
|
esac
|
|
;;
|
|
(lists)
|
|
_arguments "${_arguments_options[@]}" \
|
|
'-t+[]:TOKEN: ' \
|
|
'--token=[]:TOKEN: ' \
|
|
'-h[Print help information]' \
|
|
'--help[Print help information]' \
|
|
":: :_kabalist_cli__lists_commands" \
|
|
"*::: :->lists" \
|
|
&& ret=0
|
|
|
|
case $state in
|
|
(lists)
|
|
words=($line[1] "${words[@]}")
|
|
(( CURRENT += 1 ))
|
|
curcontext="${curcontext%:*:*}:kabalist_cli-lists-command-$line[1]:"
|
|
case $line[1] in
|
|
(create)
|
|
_arguments "${_arguments_options[@]}" \
|
|
'-h[Print help information]' \
|
|
'--help[Print help information]' \
|
|
':list:' \
|
|
&& ret=0
|
|
;;
|
|
(help)
|
|
_arguments "${_arguments_options[@]}" \
|
|
'*::subcommand -- The subcommand whose help message to display:' \
|
|
&& ret=0
|
|
;;
|
|
esac
|
|
;;
|
|
esac
|
|
;;
|
|
(completions)
|
|
_arguments "${_arguments_options[@]}" \
|
|
'-h[Print help information]' \
|
|
'--help[Print help information]' \
|
|
':shell:' \
|
|
&& ret=0
|
|
;;
|
|
(help)
|
|
_arguments "${_arguments_options[@]}" \
|
|
'*::subcommand -- The subcommand whose help message to display:' \
|
|
&& ret=0
|
|
;;
|
|
esac
|
|
;;
|
|
esac
|
|
}
|
|
|
|
(( $+functions[_kabalist_cli_commands] )) ||
|
|
_kabalist_cli_commands() {
|
|
local commands; commands=(
|
|
'account:' \
|
|
'list:' \
|
|
'lists:' \
|
|
'completions:' \
|
|
'help:Print this message or the help of the given subcommand(s)' \
|
|
)
|
|
_describe -t commands 'kabalist_cli commands' commands "$@"
|
|
}
|
|
(( $+functions[_kabalist_cli__account_commands] )) ||
|
|
_kabalist_cli__account_commands() {
|
|
local commands; commands=(
|
|
'login:' \
|
|
'recover:' \
|
|
'register:' \
|
|
'help:Print this message or the help of the given subcommand(s)' \
|
|
)
|
|
_describe -t commands 'kabalist_cli account commands' commands "$@"
|
|
}
|
|
(( $+functions[_kabalist_cli__list__add_commands] )) ||
|
|
_kabalist_cli__list__add_commands() {
|
|
local commands; commands=()
|
|
_describe -t commands 'kabalist_cli list add commands' commands "$@"
|
|
}
|
|
(( $+functions[_kabalist_cli__list__pantry__add_commands] )) ||
|
|
_kabalist_cli__list__pantry__add_commands() {
|
|
local commands; commands=()
|
|
_describe -t commands 'kabalist_cli list pantry add commands' commands "$@"
|
|
}
|
|
(( $+functions[_kabalist_cli__list__share__add_commands] )) ||
|
|
_kabalist_cli__list__share__add_commands() {
|
|
local commands; commands=()
|
|
_describe -t commands 'kabalist_cli list share add commands' commands "$@"
|
|
}
|
|
(( $+functions[_kabalist_cli__completions_commands] )) ||
|
|
_kabalist_cli__completions_commands() {
|
|
local commands; commands=()
|
|
_describe -t commands 'kabalist_cli completions commands' commands "$@"
|
|
}
|
|
(( $+functions[_kabalist_cli__lists__create_commands] )) ||
|
|
_kabalist_cli__lists__create_commands() {
|
|
local commands; commands=()
|
|
_describe -t commands 'kabalist_cli lists create commands' commands "$@"
|
|
}
|
|
(( $+functions[_kabalist_cli__list__delete_commands] )) ||
|
|
_kabalist_cli__list__delete_commands() {
|
|
local commands; commands=()
|
|
_describe -t commands 'kabalist_cli list delete commands' commands "$@"
|
|
}
|
|
(( $+functions[_kabalist_cli__list__pantry__delete_commands] )) ||
|
|
_kabalist_cli__list__pantry__delete_commands() {
|
|
local commands; commands=()
|
|
_describe -t commands 'kabalist_cli list pantry delete commands' commands "$@"
|
|
}
|
|
(( $+functions[_kabalist_cli__list__share__delete_commands] )) ||
|
|
_kabalist_cli__list__share__delete_commands() {
|
|
local commands; commands=()
|
|
_describe -t commands 'kabalist_cli list share delete commands' commands "$@"
|
|
}
|
|
(( $+functions[_kabalist_cli__list__pantry__edit_commands] )) ||
|
|
_kabalist_cli__list__pantry__edit_commands() {
|
|
local commands; commands=()
|
|
_describe -t commands 'kabalist_cli list pantry edit commands' commands "$@"
|
|
}
|
|
(( $+functions[_kabalist_cli__account__help_commands] )) ||
|
|
_kabalist_cli__account__help_commands() {
|
|
local commands; commands=()
|
|
_describe -t commands 'kabalist_cli account help commands' commands "$@"
|
|
}
|
|
(( $+functions[_kabalist_cli__help_commands] )) ||
|
|
_kabalist_cli__help_commands() {
|
|
local commands; commands=()
|
|
_describe -t commands 'kabalist_cli help commands' commands "$@"
|
|
}
|
|
(( $+functions[_kabalist_cli__list__help_commands] )) ||
|
|
_kabalist_cli__list__help_commands() {
|
|
local commands; commands=()
|
|
_describe -t commands 'kabalist_cli list help commands' commands "$@"
|
|
}
|
|
(( $+functions[_kabalist_cli__list__item__help_commands] )) ||
|
|
_kabalist_cli__list__item__help_commands() {
|
|
local commands; commands=()
|
|
_describe -t commands 'kabalist_cli list item help commands' commands "$@"
|
|
}
|
|
(( $+functions[_kabalist_cli__list__pantry__help_commands] )) ||
|
|
_kabalist_cli__list__pantry__help_commands() {
|
|
local commands; commands=()
|
|
_describe -t commands 'kabalist_cli list pantry help commands' commands "$@"
|
|
}
|
|
(( $+functions[_kabalist_cli__list__public__help_commands] )) ||
|
|
_kabalist_cli__list__public__help_commands() {
|
|
local commands; commands=()
|
|
_describe -t commands 'kabalist_cli list public help commands' commands "$@"
|
|
}
|
|
(( $+functions[_kabalist_cli__list__share__help_commands] )) ||
|
|
_kabalist_cli__list__share__help_commands() {
|
|
local commands; commands=()
|
|
_describe -t commands 'kabalist_cli list share help commands' commands "$@"
|
|
}
|
|
(( $+functions[_kabalist_cli__lists__help_commands] )) ||
|
|
_kabalist_cli__lists__help_commands() {
|
|
local commands; commands=()
|
|
_describe -t commands 'kabalist_cli lists help commands' commands "$@"
|
|
}
|
|
(( $+functions[_kabalist_cli__list__history_commands] )) ||
|
|
_kabalist_cli__list__history_commands() {
|
|
local commands; commands=()
|
|
_describe -t commands 'kabalist_cli list history commands' commands "$@"
|
|
}
|
|
(( $+functions[_kabalist_cli__list__item_commands] )) ||
|
|
_kabalist_cli__list__item_commands() {
|
|
local commands; commands=(
|
|
'tick:' \
|
|
'update:' \
|
|
'help:Print this message or the help of the given subcommand(s)' \
|
|
)
|
|
_describe -t commands 'kabalist_cli list item commands' commands "$@"
|
|
}
|
|
(( $+functions[_kabalist_cli__list_commands] )) ||
|
|
_kabalist_cli__list_commands() {
|
|
local commands; commands=(
|
|
'delete:' \
|
|
'add:' \
|
|
'item:' \
|
|
'share:' \
|
|
'public:' \
|
|
'history:' \
|
|
'pantry:' \
|
|
'help:Print this message or the help of the given subcommand(s)' \
|
|
)
|
|
_describe -t commands 'kabalist_cli list commands' commands "$@"
|
|
}
|
|
(( $+functions[_kabalist_cli__lists_commands] )) ||
|
|
_kabalist_cli__lists_commands() {
|
|
local commands; commands=(
|
|
'create:' \
|
|
'help:Print this message or the help of the given subcommand(s)' \
|
|
)
|
|
_describe -t commands 'kabalist_cli lists commands' commands "$@"
|
|
}
|
|
(( $+functions[_kabalist_cli__account__login_commands] )) ||
|
|
_kabalist_cli__account__login_commands() {
|
|
local commands; commands=()
|
|
_describe -t commands 'kabalist_cli account login commands' commands "$@"
|
|
}
|
|
(( $+functions[_kabalist_cli__list__pantry_commands] )) ||
|
|
_kabalist_cli__list__pantry_commands() {
|
|
local commands; commands=(
|
|
'add:' \
|
|
'edit:' \
|
|
'delete:' \
|
|
'refill:' \
|
|
'help:Print this message or the help of the given subcommand(s)' \
|
|
)
|
|
_describe -t commands 'kabalist_cli list pantry commands' commands "$@"
|
|
}
|
|
(( $+functions[_kabalist_cli__list__public_commands] )) ||
|
|
_kabalist_cli__list__public_commands() {
|
|
local commands; commands=(
|
|
'set:' \
|
|
'remove:' \
|
|
'help:Print this message or the help of the given subcommand(s)' \
|
|
)
|
|
_describe -t commands 'kabalist_cli list public commands' commands "$@"
|
|
}
|
|
(( $+functions[_kabalist_cli__account__recover_commands] )) ||
|
|
_kabalist_cli__account__recover_commands() {
|
|
local commands; commands=()
|
|
_describe -t commands 'kabalist_cli account recover commands' commands "$@"
|
|
}
|
|
(( $+functions[_kabalist_cli__list__pantry__refill_commands] )) ||
|
|
_kabalist_cli__list__pantry__refill_commands() {
|
|
local commands; commands=()
|
|
_describe -t commands 'kabalist_cli list pantry refill commands' commands "$@"
|
|
}
|
|
(( $+functions[_kabalist_cli__account__register_commands] )) ||
|
|
_kabalist_cli__account__register_commands() {
|
|
local commands; commands=()
|
|
_describe -t commands 'kabalist_cli account register commands' commands "$@"
|
|
}
|
|
(( $+functions[_kabalist_cli__list__public__remove_commands] )) ||
|
|
_kabalist_cli__list__public__remove_commands() {
|
|
local commands; commands=()
|
|
_describe -t commands 'kabalist_cli list public remove commands' commands "$@"
|
|
}
|
|
(( $+functions[_kabalist_cli__list__public__set_commands] )) ||
|
|
_kabalist_cli__list__public__set_commands() {
|
|
local commands; commands=()
|
|
_describe -t commands 'kabalist_cli list public set commands' commands "$@"
|
|
}
|
|
(( $+functions[_kabalist_cli__list__share_commands] )) ||
|
|
_kabalist_cli__list__share_commands() {
|
|
local commands; commands=(
|
|
'add:' \
|
|
'delete:' \
|
|
'help:Print this message or the help of the given subcommand(s)' \
|
|
)
|
|
_describe -t commands 'kabalist_cli list share commands' commands "$@"
|
|
}
|
|
(( $+functions[_kabalist_cli__list__item__tick_commands] )) ||
|
|
_kabalist_cli__list__item__tick_commands() {
|
|
local commands; commands=()
|
|
_describe -t commands 'kabalist_cli list item tick commands' commands "$@"
|
|
}
|
|
(( $+functions[_kabalist_cli__list__item__update_commands] )) ||
|
|
_kabalist_cli__list__item__update_commands() {
|
|
local commands; commands=()
|
|
_describe -t commands 'kabalist_cli list item update commands' commands "$@"
|
|
}
|
|
|
|
_kabalist_cli "$@"
|