#compdef clipcatctl

autoload -U is-at-least

_clipcatctl() {
    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[@]}" : \
'-c+[Specify a configuration file]:CONFIG_FILE:_files' \
'--config=[Specify a configuration file]:CONFIG_FILE:_files' \
'--server-endpoint=[Specify a server endpoint]:SERVER_ENDPOINT:_default' \
'--log-level=[Specify a log level]:LOG_LEVEL:_default' \
'-h[Print help]' \
'--help[Print help]' \
'-V[Print version]' \
'--version[Print version]' \
":: :_clipcatctl_commands" \
"*::: :->clipcatctl" \
&& ret=0
    case $state in
    (clipcatctl)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:clipcatctl-command-$line[1]:"
        case $line[1] in
            (version)
_arguments "${_arguments_options[@]}" : \
'--client[If true, shows client version only (no server required).]' \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(completions)
_arguments "${_arguments_options[@]}" : \
'-h[Print help]' \
'--help[Print help]' \
':shell:(bash elvish fish powershell zsh)' \
&& ret=0
;;
(default-config)
_arguments "${_arguments_options[@]}" : \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(insert)
_arguments "${_arguments_options[@]}" : \
'*-k+[Specify which clipboard to insert ("clipboard", "primary", "secondary")]:KINDS:_default' \
'*--kinds=[Specify which clipboard to insert ("clipboard", "primary", "secondary")]:KINDS:_default' \
'-h[Print help]' \
'--help[Print help]' \
':data:_default' \
&& ret=0
;;
(load)
_arguments "${_arguments_options[@]}" : \
'*-k+[Specify which clipboard to insert ("clipboard", "primary", "secondary")]:KINDS:_default' \
'*--kinds=[Specify which clipboard to insert ("clipboard", "primary", "secondary")]:KINDS:_default' \
'-m+[Specify the MIME type of the content]:MIME:_default' \
'--mime=[Specify the MIME type of the content]:MIME:_default' \
'-f+[]:FILE_PATH:_files' \
'--file=[]:FILE_PATH:_files' \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(save)
_arguments "${_arguments_options[@]}" : \
'-k+[Specify which clipboard to extract ("clipboard", "primary", "secondary")]:KIND:_default' \
'--kind=[Specify which clipboard to extract ("clipboard", "primary", "secondary")]:KIND:_default' \
'-f+[]:FILE_PATH:_files' \
'--file=[]:FILE_PATH:_files' \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(get)
_arguments "${_arguments_options[@]}" : \
'-h[Print help]' \
'--help[Print help]' \
'::id:_default' \
&& ret=0
;;
(list)
_arguments "${_arguments_options[@]}" : \
'--no-id[]' \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(update)
_arguments "${_arguments_options[@]}" : \
'-h[Print help]' \
'--help[Print help]' \
':id:_default' \
':data:_default' \
&& ret=0
;;
(edit)
_arguments "${_arguments_options[@]}" : \
'-e+[]:EDITOR:_default' \
'--editor=[]:EDITOR:_default' \
'-h[Print help]' \
'--help[Print help]' \
':id:_default' \
&& ret=0
;;
(remove)
_arguments "${_arguments_options[@]}" : \
'-h[Print help]' \
'--help[Print help]' \
'*::ids:_default' \
&& ret=0
;;
(promote)
_arguments "${_arguments_options[@]}" : \
'*-k+[Specify which clipboard to insert ("clipboard", "primary", "secondary")]:KINDS:_default' \
'*--kinds=[Specify which clipboard to insert ("clipboard", "primary", "secondary")]:KINDS:_default' \
'-h[Print help]' \
'--help[Print help]' \
':id:_default' \
&& ret=0
;;
(clear)
_arguments "${_arguments_options[@]}" : \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(length)
_arguments "${_arguments_options[@]}" : \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(enable-watcher)
_arguments "${_arguments_options[@]}" : \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(disable-watcher)
_arguments "${_arguments_options[@]}" : \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(toggle-watcher)
_arguments "${_arguments_options[@]}" : \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(get-watcher-state)
_arguments "${_arguments_options[@]}" : \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
":: :_clipcatctl__help_commands" \
"*::: :->help" \
&& ret=0

    case $state in
    (help)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:clipcatctl-help-command-$line[1]:"
        case $line[1] in
            (version)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(completions)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(default-config)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(insert)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(load)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(save)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(get)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(list)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(update)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(edit)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(remove)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(promote)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(clear)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(length)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(enable-watcher)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(disable-watcher)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(toggle-watcher)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(get-watcher-state)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
        esac
    ;;
esac
;;
        esac
    ;;
esac
}

(( $+functions[_clipcatctl_commands] )) ||
_clipcatctl_commands() {
    local commands; commands=(
'version:Print the client and server version information' \
'completions:Output shell completion code for the specified shell (bash, zsh, fish)' \
'default-config:Output default configuration' \
'insert:Insert new clip into clipboard' \
'load:Loads file into clipboard' \
'save:Paste content of current clipboard into file' \
'get:Print clip with <id>' \
'list:Print history of clipboard' \
'update:Update clip with <id>' \
'edit:Edit clip with <id>' \
'remove:Remove clips with \[ids\]' \
'promote:Replace content of clipboard with clip with <id>' \
'clear:Remove all clips in clipboard' \
'length:Print length of clipboard history' \
'enable-watcher:Enable clipboard watcher' \
'disable-watcher:Disable clipboard watcher' \
'toggle-watcher:Toggle clipboard watcher' \
'get-watcher-state:Get clipboard watcher state' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'clipcatctl commands' commands "$@"
}
(( $+functions[_clipcatctl__clear_commands] )) ||
_clipcatctl__clear_commands() {
    local commands; commands=()
    _describe -t commands 'clipcatctl clear commands' commands "$@"
}
(( $+functions[_clipcatctl__completions_commands] )) ||
_clipcatctl__completions_commands() {
    local commands; commands=()
    _describe -t commands 'clipcatctl completions commands' commands "$@"
}
(( $+functions[_clipcatctl__default-config_commands] )) ||
_clipcatctl__default-config_commands() {
    local commands; commands=()
    _describe -t commands 'clipcatctl default-config commands' commands "$@"
}
(( $+functions[_clipcatctl__disable-watcher_commands] )) ||
_clipcatctl__disable-watcher_commands() {
    local commands; commands=()
    _describe -t commands 'clipcatctl disable-watcher commands' commands "$@"
}
(( $+functions[_clipcatctl__edit_commands] )) ||
_clipcatctl__edit_commands() {
    local commands; commands=()
    _describe -t commands 'clipcatctl edit commands' commands "$@"
}
(( $+functions[_clipcatctl__enable-watcher_commands] )) ||
_clipcatctl__enable-watcher_commands() {
    local commands; commands=()
    _describe -t commands 'clipcatctl enable-watcher commands' commands "$@"
}
(( $+functions[_clipcatctl__get_commands] )) ||
_clipcatctl__get_commands() {
    local commands; commands=()
    _describe -t commands 'clipcatctl get commands' commands "$@"
}
(( $+functions[_clipcatctl__get-watcher-state_commands] )) ||
_clipcatctl__get-watcher-state_commands() {
    local commands; commands=()
    _describe -t commands 'clipcatctl get-watcher-state commands' commands "$@"
}
(( $+functions[_clipcatctl__help_commands] )) ||
_clipcatctl__help_commands() {
    local commands; commands=(
'version:Print the client and server version information' \
'completions:Output shell completion code for the specified shell (bash, zsh, fish)' \
'default-config:Output default configuration' \
'insert:Insert new clip into clipboard' \
'load:Loads file into clipboard' \
'save:Paste content of current clipboard into file' \
'get:Print clip with <id>' \
'list:Print history of clipboard' \
'update:Update clip with <id>' \
'edit:Edit clip with <id>' \
'remove:Remove clips with \[ids\]' \
'promote:Replace content of clipboard with clip with <id>' \
'clear:Remove all clips in clipboard' \
'length:Print length of clipboard history' \
'enable-watcher:Enable clipboard watcher' \
'disable-watcher:Disable clipboard watcher' \
'toggle-watcher:Toggle clipboard watcher' \
'get-watcher-state:Get clipboard watcher state' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'clipcatctl help commands' commands "$@"
}
(( $+functions[_clipcatctl__help__clear_commands] )) ||
_clipcatctl__help__clear_commands() {
    local commands; commands=()
    _describe -t commands 'clipcatctl help clear commands' commands "$@"
}
(( $+functions[_clipcatctl__help__completions_commands] )) ||
_clipcatctl__help__completions_commands() {
    local commands; commands=()
    _describe -t commands 'clipcatctl help completions commands' commands "$@"
}
(( $+functions[_clipcatctl__help__default-config_commands] )) ||
_clipcatctl__help__default-config_commands() {
    local commands; commands=()
    _describe -t commands 'clipcatctl help default-config commands' commands "$@"
}
(( $+functions[_clipcatctl__help__disable-watcher_commands] )) ||
_clipcatctl__help__disable-watcher_commands() {
    local commands; commands=()
    _describe -t commands 'clipcatctl help disable-watcher commands' commands "$@"
}
(( $+functions[_clipcatctl__help__edit_commands] )) ||
_clipcatctl__help__edit_commands() {
    local commands; commands=()
    _describe -t commands 'clipcatctl help edit commands' commands "$@"
}
(( $+functions[_clipcatctl__help__enable-watcher_commands] )) ||
_clipcatctl__help__enable-watcher_commands() {
    local commands; commands=()
    _describe -t commands 'clipcatctl help enable-watcher commands' commands "$@"
}
(( $+functions[_clipcatctl__help__get_commands] )) ||
_clipcatctl__help__get_commands() {
    local commands; commands=()
    _describe -t commands 'clipcatctl help get commands' commands "$@"
}
(( $+functions[_clipcatctl__help__get-watcher-state_commands] )) ||
_clipcatctl__help__get-watcher-state_commands() {
    local commands; commands=()
    _describe -t commands 'clipcatctl help get-watcher-state commands' commands "$@"
}
(( $+functions[_clipcatctl__help__help_commands] )) ||
_clipcatctl__help__help_commands() {
    local commands; commands=()
    _describe -t commands 'clipcatctl help help commands' commands "$@"
}
(( $+functions[_clipcatctl__help__insert_commands] )) ||
_clipcatctl__help__insert_commands() {
    local commands; commands=()
    _describe -t commands 'clipcatctl help insert commands' commands "$@"
}
(( $+functions[_clipcatctl__help__length_commands] )) ||
_clipcatctl__help__length_commands() {
    local commands; commands=()
    _describe -t commands 'clipcatctl help length commands' commands "$@"
}
(( $+functions[_clipcatctl__help__list_commands] )) ||
_clipcatctl__help__list_commands() {
    local commands; commands=()
    _describe -t commands 'clipcatctl help list commands' commands "$@"
}
(( $+functions[_clipcatctl__help__load_commands] )) ||
_clipcatctl__help__load_commands() {
    local commands; commands=()
    _describe -t commands 'clipcatctl help load commands' commands "$@"
}
(( $+functions[_clipcatctl__help__promote_commands] )) ||
_clipcatctl__help__promote_commands() {
    local commands; commands=()
    _describe -t commands 'clipcatctl help promote commands' commands "$@"
}
(( $+functions[_clipcatctl__help__remove_commands] )) ||
_clipcatctl__help__remove_commands() {
    local commands; commands=()
    _describe -t commands 'clipcatctl help remove commands' commands "$@"
}
(( $+functions[_clipcatctl__help__save_commands] )) ||
_clipcatctl__help__save_commands() {
    local commands; commands=()
    _describe -t commands 'clipcatctl help save commands' commands "$@"
}
(( $+functions[_clipcatctl__help__toggle-watcher_commands] )) ||
_clipcatctl__help__toggle-watcher_commands() {
    local commands; commands=()
    _describe -t commands 'clipcatctl help toggle-watcher commands' commands "$@"
}
(( $+functions[_clipcatctl__help__update_commands] )) ||
_clipcatctl__help__update_commands() {
    local commands; commands=()
    _describe -t commands 'clipcatctl help update commands' commands "$@"
}
(( $+functions[_clipcatctl__help__version_commands] )) ||
_clipcatctl__help__version_commands() {
    local commands; commands=()
    _describe -t commands 'clipcatctl help version commands' commands "$@"
}
(( $+functions[_clipcatctl__insert_commands] )) ||
_clipcatctl__insert_commands() {
    local commands; commands=()
    _describe -t commands 'clipcatctl insert commands' commands "$@"
}
(( $+functions[_clipcatctl__length_commands] )) ||
_clipcatctl__length_commands() {
    local commands; commands=()
    _describe -t commands 'clipcatctl length commands' commands "$@"
}
(( $+functions[_clipcatctl__list_commands] )) ||
_clipcatctl__list_commands() {
    local commands; commands=()
    _describe -t commands 'clipcatctl list commands' commands "$@"
}
(( $+functions[_clipcatctl__load_commands] )) ||
_clipcatctl__load_commands() {
    local commands; commands=()
    _describe -t commands 'clipcatctl load commands' commands "$@"
}
(( $+functions[_clipcatctl__promote_commands] )) ||
_clipcatctl__promote_commands() {
    local commands; commands=()
    _describe -t commands 'clipcatctl promote commands' commands "$@"
}
(( $+functions[_clipcatctl__remove_commands] )) ||
_clipcatctl__remove_commands() {
    local commands; commands=()
    _describe -t commands 'clipcatctl remove commands' commands "$@"
}
(( $+functions[_clipcatctl__save_commands] )) ||
_clipcatctl__save_commands() {
    local commands; commands=()
    _describe -t commands 'clipcatctl save commands' commands "$@"
}
(( $+functions[_clipcatctl__toggle-watcher_commands] )) ||
_clipcatctl__toggle-watcher_commands() {
    local commands; commands=()
    _describe -t commands 'clipcatctl toggle-watcher commands' commands "$@"
}
(( $+functions[_clipcatctl__update_commands] )) ||
_clipcatctl__update_commands() {
    local commands; commands=()
    _describe -t commands 'clipcatctl update commands' commands "$@"
}
(( $+functions[_clipcatctl__version_commands] )) ||
_clipcatctl__version_commands() {
    local commands; commands=()
    _describe -t commands 'clipcatctl version commands' commands "$@"
}

if [ "$funcstack[1]" = "_clipcatctl" ]; then
    _clipcatctl "$@"
else
    compdef _clipcatctl clipcatctl
fi
