#compdef pvapconfig

autoload -U is-at-least

_pvapconfig() {
    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+[Provide a custom config file (overwrites default /etc/pvapconfig.yaml)]:FILE:_default' \
'--config=[Provide a custom config file (overwrites default /etc/pvapconfig.yaml)]:FILE:_default' \
'-n[Dry run\: display the actions but don'\''t actually perform them on the APQNs]' \
'--dry-run[Dry run\: display the actions but don'\''t actually perform them on the APQNs]' \
'--strict[Enforce strict match\: All config entries need to be fulfilled]' \
'(-c --config --strict)--unbind[Unbind all available APQNs]' \
'-v[Provide more detailed output]' \
'--verbose[Provide more detailed output]' \
'-V[Print version information and exit]' \
'--version[Print version information and exit]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
&& ret=0
}

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

if [ "$funcstack[1]" = "_pvapconfig" ]; then
    _pvapconfig "$@"
else
    compdef _pvapconfig pvapconfig
fi
