#compdef mmtc

autoload -U is-at-least

_mmtc() {
    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+[Run mpd commands and exit]' \
'*--cmd=[Run mpd commands and exit]' \
'--address=[Specify the address of the mpd server]:address: ' \
'-c+[Specify the config file]:file:_files' \
'--config=[Specify the config file]:file:_files' \
'--jump-lines=[The number of lines to jump]:number: ' \
'--seek-secs=[The time to seek in seconds]:number: ' \
'--ups=[The amount of status updates per second]:number: ' \
'--clear-query-on-play[Clear query on play]' \
'--cycle[Cycle through the queue]' \
'--no-clear-query-on-play[Don'\''t clear query on play]' \
'--no-cycle[Don'\''t cycle through the queue]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'-V[Print version]' \
'--version[Print version]' \
&& ret=0
}

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

if [ "$funcstack[1]" = "_mmtc" ]; then
    _mmtc "$@"
else
    compdef _mmtc mmtc
fi
