#compdef thqm

autoload -U is-at-least

_thqm() {
    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[@]}" \
'-p+[Set the server'\''s port.]: : ' \
'--port=[Set the server'\''s port.]: : ' \
'-u+[Authentication username.]: : ' \
'--username=[Authentication username.]: : ' \
'-P+[Authentication password.]: : ' \
'--password=[Authentication password.]: : ' \
'-S+[Entry separator.]: : ' \
'--separator=[Entry separator.]: : ' \
'-t+[Page title.]: : ' \
'--title=[Page title.]: : ' \
'-s+[Page style.]: :($(thqm --list-styles))' \
'--style=[Page style.]: :($(thqm --list-styles))' \
'--interface=[Network interface to use to determine ip.]: : ' \
'--save-qrcode=[Save the qrcode image to file.]: : ' \
'-h[Print help information]' \
'--help[Print help information]' \
'-V[Print version information]' \
'--version[Print version information]' \
'--list-styles[List available page styles.]' \
'-q[Show the qrcode in terminal.]' \
'--show-qrcode[Show the qrcode in terminal.]' \
'-U[Show the page url.]' \
'--show-url[Show the page url.]' \
'--oneshot[Shutdown server after first selection.]' \
'--custom-input[Show custom input field.]' \
'--no-shutdown[Don'\''t allow the server to be shutdown from the page.]' \
'--no-qrcode[Don'\''t show the qrcode on the page.]' \
&& ret=0
}

(( $+functions[_thqm_commands] )) ||
_thqm_commands() {
    local commands; commands=()
    _describe -t commands 'thqm commands' commands "$@"
}

_thqm "$@"
