#compdef alpm-soname

autoload -U is-at-least

_alpm-soname() {
    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[@]}" : \
'*-v[Increase logging verbosity]' \
'*--verbose[Increase logging verbosity]' \
'(-v --verbose)*-q[Decrease logging verbosity]' \
'(-v --verbose)*--quiet[Decrease logging verbosity]' \
'-h[Print help]' \
'--help[Print help]' \
'-V[Print version]' \
'--version[Print version]' \
":: :_alpm-soname_commands" \
"*::: :->alpm-soname" \
&& ret=0
    case $state in
    (alpm-soname)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:alpm-soname-command-$line[1]:"
        case $line[1] in
            (get-provisions)
_arguments "${_arguments_options[@]}" : \
'-l+[The lookup directory for shared libraries in \`<prefix>\:<directory>\` format]:LOOKUP_DIR:_default' \
'--lookup-dir=[The lookup directory for shared libraries in \`<prefix>\:<directory>\` format]:LOOKUP_DIR:_default' \
'-o+[The output format]:OUTPUT_FORMAT:((plain\:"The plain text output format (line by line)"
json\:"The JSON output format"))' \
'--output-format=[The output format]:OUTPUT_FORMAT:((plain\:"The plain text output format (line by line)"
json\:"The JSON output format"))' \
'-p[Pretty-print the output]' \
'--pretty[Pretty-print the output]' \
'*-v[Increase logging verbosity]' \
'*--verbose[Increase logging verbosity]' \
'(-v --verbose)*-q[Decrease logging verbosity]' \
'(-v --verbose)*--quiet[Decrease logging verbosity]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'-V[Print version]' \
'--version[Print version]' \
':package -- The package to inspect:_files' \
&& ret=0
;;
(get-dependencies)
_arguments "${_arguments_options[@]}" : \
'-l+[The lookup directory for shared libraries in \`<prefix>\:<directory>\` format]:LOOKUP_DIR:_default' \
'--lookup-dir=[The lookup directory for shared libraries in \`<prefix>\:<directory>\` format]:LOOKUP_DIR:_default' \
'-o+[The output format]:OUTPUT_FORMAT:((plain\:"The plain text output format (line by line)"
json\:"The JSON output format"))' \
'--output-format=[The output format]:OUTPUT_FORMAT:((plain\:"The plain text output format (line by line)"
json\:"The JSON output format"))' \
'-p[Pretty-print the output]' \
'--pretty[Pretty-print the output]' \
'*-v[Increase logging verbosity]' \
'*--verbose[Increase logging verbosity]' \
'(-v --verbose)*-q[Decrease logging verbosity]' \
'(-v --verbose)*--quiet[Decrease logging verbosity]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'-V[Print version]' \
'--version[Print version]' \
':package -- The package to inspect:_files' \
&& ret=0
;;
(get-raw-dependencies)
_arguments "${_arguments_options[@]}" : \
'-o+[The output format]:OUTPUT_FORMAT:((plain\:"The plain text output format (line by line)"
json\:"The JSON output format"))' \
'--output-format=[The output format]:OUTPUT_FORMAT:((plain\:"The plain text output format (line by line)"
json\:"The JSON output format"))' \
'-p[Pretty-print the output]' \
'--pretty[Pretty-print the output]' \
'*-v[Increase logging verbosity]' \
'*--verbose[Increase logging verbosity]' \
'(-v --verbose)*-q[Decrease logging verbosity]' \
'(-v --verbose)*--quiet[Decrease logging verbosity]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'-V[Print version]' \
'--version[Print version]' \
':package -- The package to inspect:_files' \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
":: :_alpm-soname__help_commands" \
"*::: :->help" \
&& ret=0

    case $state in
    (help)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:alpm-soname-help-command-$line[1]:"
        case $line[1] in
            (get-provisions)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(get-dependencies)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(get-raw-dependencies)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
        esac
    ;;
esac
;;
        esac
    ;;
esac
}

(( $+functions[_alpm-soname_commands] )) ||
_alpm-soname_commands() {
    local commands; commands=(
'get-provisions:Get provisions' \
'get-dependencies:Get dependencies' \
'get-raw-dependencies:Get raw dependencies without filtering by lookup directory' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'alpm-soname commands' commands "$@"
}
(( $+functions[_alpm-soname__get-dependencies_commands] )) ||
_alpm-soname__get-dependencies_commands() {
    local commands; commands=()
    _describe -t commands 'alpm-soname get-dependencies commands' commands "$@"
}
(( $+functions[_alpm-soname__get-provisions_commands] )) ||
_alpm-soname__get-provisions_commands() {
    local commands; commands=()
    _describe -t commands 'alpm-soname get-provisions commands' commands "$@"
}
(( $+functions[_alpm-soname__get-raw-dependencies_commands] )) ||
_alpm-soname__get-raw-dependencies_commands() {
    local commands; commands=()
    _describe -t commands 'alpm-soname get-raw-dependencies commands' commands "$@"
}
(( $+functions[_alpm-soname__help_commands] )) ||
_alpm-soname__help_commands() {
    local commands; commands=(
'get-provisions:Get provisions' \
'get-dependencies:Get dependencies' \
'get-raw-dependencies:Get raw dependencies without filtering by lookup directory' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'alpm-soname help commands' commands "$@"
}
(( $+functions[_alpm-soname__help__get-dependencies_commands] )) ||
_alpm-soname__help__get-dependencies_commands() {
    local commands; commands=()
    _describe -t commands 'alpm-soname help get-dependencies commands' commands "$@"
}
(( $+functions[_alpm-soname__help__get-provisions_commands] )) ||
_alpm-soname__help__get-provisions_commands() {
    local commands; commands=()
    _describe -t commands 'alpm-soname help get-provisions commands' commands "$@"
}
(( $+functions[_alpm-soname__help__get-raw-dependencies_commands] )) ||
_alpm-soname__help__get-raw-dependencies_commands() {
    local commands; commands=()
    _describe -t commands 'alpm-soname help get-raw-dependencies commands' commands "$@"
}
(( $+functions[_alpm-soname__help__help_commands] )) ||
_alpm-soname__help__help_commands() {
    local commands; commands=()
    _describe -t commands 'alpm-soname help help commands' commands "$@"
}

if [ "$funcstack[1]" = "_alpm-soname" ]; then
    _alpm-soname "$@"
else
    compdef _alpm-soname alpm-soname
fi
