#compdef alpm-db-desc

autoload -U is-at-least

_alpm-db-desc() {
    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[@]}" : \
'-h[Print help]' \
'--help[Print help]' \
'-V[Print version]' \
'--version[Print version]' \
":: :_alpm-db-desc_commands" \
"*::: :->alpm-db-desc" \
&& ret=0
    case $state in
    (alpm-db-desc)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:alpm-db-desc-command-$line[1]:"
        case $line[1] in
            (create)
_arguments "${_arguments_options[@]}" : \
'-h[Print help]' \
'--help[Print help]' \
":: :_alpm-db-desc__create_commands" \
"*::: :->create" \
&& ret=0

    case $state in
    (create)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:alpm-db-desc-create-command-$line[1]:"
        case $line[1] in
            (v1)
_arguments "${_arguments_options[@]}" : \
'--name=[The package name]:NAME:_default' \
'--version=[The package version]:VERSION:_default' \
'--base=[The package base]:BASE:_default' \
'--description=[The package description]:DESCRIPTION:_default' \
'--url=[The package URL]:URL:_default' \
'--arch=[The package architecture]:ARCH:_default' \
'--builddate=[The package build date]:BUILDDATE:_default' \
'--installdate=[The package install date]:INSTALLDATE:_default' \
'--packager=[The packager]:PACKAGER:_default' \
'--size=[The installed size]:SIZE:_default' \
'*--groups=[The package groups]:GROUPS:_default' \
'--reason=[The package install reason]:REASON:_default' \
'*--license=[The package licenses]:LICENSE:_default' \
'--validation=[The package validation methods]:VALIDATION:_default' \
'*--replaces=[The replaces]:REPLACES:_default' \
'*--depends=[The dependencies]:DEPENDS:_default' \
'*--optdepends=[The optional dependencies]:OPTDEPENDS:_default' \
'*--conflicts=[The conflicts]:CONFLICTS:_default' \
'*--provides=[The provides]:PROVIDES:_default' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'::output -- The output file:_files' \
&& ret=0
;;
(v2)
_arguments "${_arguments_options[@]}" : \
'--name=[The package name]:NAME:_default' \
'--version=[The package version]:VERSION:_default' \
'--base=[The package base]:BASE:_default' \
'--description=[The package description]:DESCRIPTION:_default' \
'--url=[The package URL]:URL:_default' \
'--arch=[The package architecture]:ARCH:_default' \
'--builddate=[The package build date]:BUILDDATE:_default' \
'--installdate=[The package install date]:INSTALLDATE:_default' \
'--packager=[The packager]:PACKAGER:_default' \
'--size=[The installed size]:SIZE:_default' \
'*--groups=[The package groups]:GROUPS:_default' \
'--reason=[The package install reason]:REASON:_default' \
'*--license=[The package licenses]:LICENSE:_default' \
'--validation=[The package validation methods]:VALIDATION:_default' \
'*--replaces=[The replaces]:REPLACES:_default' \
'*--depends=[The dependencies]:DEPENDS:_default' \
'*--optdepends=[The optional dependencies]:OPTDEPENDS:_default' \
'*--conflicts=[The conflicts]:CONFLICTS:_default' \
'*--provides=[The provides]:PROVIDES:_default' \
'*--xdata=[Structured extra metadata]:XDATA:_default' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'::output -- The output file:_files' \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
":: :_alpm-db-desc__create__help_commands" \
"*::: :->help" \
&& ret=0

    case $state in
    (help)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:alpm-db-desc-create-help-command-$line[1]:"
        case $line[1] in
            (v1)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(v2)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
        esac
    ;;
esac
;;
        esac
    ;;
esac
;;
(validate)
_arguments "${_arguments_options[@]}" : \
'-s+[Provide the schema version to use]:VERSION:_default' \
'--schema=[Provide the schema version to use]:VERSION:_default' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'::file -- Provide the file to read:_files' \
&& ret=0
;;
(format)
_arguments "${_arguments_options[@]}" : \
'-s+[Provide the schema version to use]:VERSION:_default' \
'--schema=[Provide the schema version to use]:VERSION:_default' \
'-o+[Provide the output format]:OUTPUT_FORMAT:((json\:"The JSON output format"))' \
'--output-format=[Provide the output format]:OUTPUT_FORMAT:((json\:"The JSON output format"))' \
'-p[Pretty-print the output]' \
'--pretty[Pretty-print the output]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'::file -- Provide the file to read:_files' \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
":: :_alpm-db-desc__help_commands" \
"*::: :->help" \
&& ret=0

    case $state in
    (help)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:alpm-db-desc-help-command-$line[1]:"
        case $line[1] in
            (create)
_arguments "${_arguments_options[@]}" : \
":: :_alpm-db-desc__help__create_commands" \
"*::: :->create" \
&& ret=0

    case $state in
    (create)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:alpm-db-desc-help-create-command-$line[1]:"
        case $line[1] in
            (v1)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(v2)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
        esac
    ;;
esac
;;
(validate)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(format)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
        esac
    ;;
esac
;;
        esac
    ;;
esac
}

(( $+functions[_alpm-db-desc_commands] )) ||
_alpm-db-desc_commands() {
    local commands; commands=(
'create:Create a DB desc file according to a schema' \
'validate:Validate a DB desc file according to a schema' \
'format:Parse and output a DB desc file in a different format' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'alpm-db-desc commands' commands "$@"
}
(( $+functions[_alpm-db-desc__create_commands] )) ||
_alpm-db-desc__create_commands() {
    local commands; commands=(
'v1:Create a DB desc version 1 file' \
'v2:Create a DB desc version 2 file' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'alpm-db-desc create commands' commands "$@"
}
(( $+functions[_alpm-db-desc__create__help_commands] )) ||
_alpm-db-desc__create__help_commands() {
    local commands; commands=(
'v1:Create a DB desc version 1 file' \
'v2:Create a DB desc version 2 file' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'alpm-db-desc create help commands' commands "$@"
}
(( $+functions[_alpm-db-desc__create__help__help_commands] )) ||
_alpm-db-desc__create__help__help_commands() {
    local commands; commands=()
    _describe -t commands 'alpm-db-desc create help help commands' commands "$@"
}
(( $+functions[_alpm-db-desc__create__help__v1_commands] )) ||
_alpm-db-desc__create__help__v1_commands() {
    local commands; commands=()
    _describe -t commands 'alpm-db-desc create help v1 commands' commands "$@"
}
(( $+functions[_alpm-db-desc__create__help__v2_commands] )) ||
_alpm-db-desc__create__help__v2_commands() {
    local commands; commands=()
    _describe -t commands 'alpm-db-desc create help v2 commands' commands "$@"
}
(( $+functions[_alpm-db-desc__create__v1_commands] )) ||
_alpm-db-desc__create__v1_commands() {
    local commands; commands=()
    _describe -t commands 'alpm-db-desc create v1 commands' commands "$@"
}
(( $+functions[_alpm-db-desc__create__v2_commands] )) ||
_alpm-db-desc__create__v2_commands() {
    local commands; commands=()
    _describe -t commands 'alpm-db-desc create v2 commands' commands "$@"
}
(( $+functions[_alpm-db-desc__format_commands] )) ||
_alpm-db-desc__format_commands() {
    local commands; commands=()
    _describe -t commands 'alpm-db-desc format commands' commands "$@"
}
(( $+functions[_alpm-db-desc__help_commands] )) ||
_alpm-db-desc__help_commands() {
    local commands; commands=(
'create:Create a DB desc file according to a schema' \
'validate:Validate a DB desc file according to a schema' \
'format:Parse and output a DB desc file in a different format' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'alpm-db-desc help commands' commands "$@"
}
(( $+functions[_alpm-db-desc__help__create_commands] )) ||
_alpm-db-desc__help__create_commands() {
    local commands; commands=(
'v1:Create a DB desc version 1 file' \
'v2:Create a DB desc version 2 file' \
    )
    _describe -t commands 'alpm-db-desc help create commands' commands "$@"
}
(( $+functions[_alpm-db-desc__help__create__v1_commands] )) ||
_alpm-db-desc__help__create__v1_commands() {
    local commands; commands=()
    _describe -t commands 'alpm-db-desc help create v1 commands' commands "$@"
}
(( $+functions[_alpm-db-desc__help__create__v2_commands] )) ||
_alpm-db-desc__help__create__v2_commands() {
    local commands; commands=()
    _describe -t commands 'alpm-db-desc help create v2 commands' commands "$@"
}
(( $+functions[_alpm-db-desc__help__format_commands] )) ||
_alpm-db-desc__help__format_commands() {
    local commands; commands=()
    _describe -t commands 'alpm-db-desc help format commands' commands "$@"
}
(( $+functions[_alpm-db-desc__help__help_commands] )) ||
_alpm-db-desc__help__help_commands() {
    local commands; commands=()
    _describe -t commands 'alpm-db-desc help help commands' commands "$@"
}
(( $+functions[_alpm-db-desc__help__validate_commands] )) ||
_alpm-db-desc__help__validate_commands() {
    local commands; commands=()
    _describe -t commands 'alpm-db-desc help validate commands' commands "$@"
}
(( $+functions[_alpm-db-desc__validate_commands] )) ||
_alpm-db-desc__validate_commands() {
    local commands; commands=()
    _describe -t commands 'alpm-db-desc validate commands' commands "$@"
}

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