#compdef alpm-repo-desc

autoload -U is-at-least

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

    case $state in
    (create)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:alpm-repo-desc-create-command-$line[1]:"
        case $line[1] in
            (v1)
_arguments "${_arguments_options[@]}" : \
'--filename=[The package file name]:FILENAME:_default' \
'--name=[The package name]:NAME:_default' \
'--base=[The name of the package base, from which this package originates]:BASE:_default' \
'--version=[The version of the package]:VERSION:_default' \
'--description=[The description of the package]:DESCRIPTION:_default' \
'*--groups=[The groups this package belongs to]:GROUPS:_default' \
'--csize=[The compressed size of the package in bytes]:CSIZE:_default' \
'--isize=[The size of the uncompressed and unpacked package contents in bytes]:ISIZE:_default' \
'--sha256sum=[The SHA256 checksum of the package file]:SHA256SUM:_default' \
'--url=[The optional URL associated with the package]:URL:_default' \
'*--license=[Set of licenses under which the package is distributed]:LICENSE:_default' \
'--arch=[The architecture of the package]:ARCH:_default' \
'--builddate=[The date at wchich the build of the package started]:BUILDDATE:_default' \
'--packager=[The User ID of the entity, that built the package]:PACKAGER:_default' \
'*--replaces=[Virtual components or packages that this package replaces upon installation]:REPLACES:_default' \
'*--conflicts=[Virtual components or packages that this package conflicts with]:CONFLICTS:_default' \
'*--provides=[Virtual components or packages that this package provides]:PROVIDES:_default' \
'*--depends=[Run-time dependencies required by the package]:DEPENDS:_default' \
'*--optdepends=[Optional dependencies that are not strictly required by the package]:OPTDEPENDS:_default' \
'*--makedepends=[Dependencies for building the upstream software of the package]:MAKEDEPENDS:_default' \
'*--checkdepends=[A dependency for running tests of the package'\''s upstream project]:CHECKDEPENDS:_default' \
'--md5sum=[The MD5 checksum of the package file]:MD5SUM:_default' \
'--pgpsig=[The base64-encoded OpenPGP detached signature of the package file]:PGPSIG:_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[@]}" : \
'--filename=[The package file name]:FILENAME:_default' \
'--name=[The package name]:NAME:_default' \
'--base=[The name of the package base, from which this package originates]:BASE:_default' \
'--version=[The version of the package]:VERSION:_default' \
'--description=[The description of the package]:DESCRIPTION:_default' \
'*--groups=[The groups this package belongs to]:GROUPS:_default' \
'--csize=[The compressed size of the package in bytes]:CSIZE:_default' \
'--isize=[The size of the uncompressed and unpacked package contents in bytes]:ISIZE:_default' \
'--sha256sum=[The SHA256 checksum of the package file]:SHA256SUM:_default' \
'--url=[The optional URL associated with the package]:URL:_default' \
'*--license=[Set of licenses under which the package is distributed]:LICENSE:_default' \
'--arch=[The architecture of the package]:ARCH:_default' \
'--builddate=[The date at wchich the build of the package started]:BUILDDATE:_default' \
'--packager=[The User ID of the entity, that built the package]:PACKAGER:_default' \
'*--replaces=[Virtual components or packages that this package replaces upon installation]:REPLACES:_default' \
'*--conflicts=[Virtual components or packages that this package conflicts with]:CONFLICTS:_default' \
'*--provides=[Virtual components or packages that this package provides]:PROVIDES:_default' \
'*--depends=[Run-time dependencies required by the package]:DEPENDS:_default' \
'*--optdepends=[Optional dependencies that are not strictly required by the package]:OPTDEPENDS:_default' \
'*--makedepends=[Dependencies for building the upstream software of the package]:MAKEDEPENDS:_default' \
'*--checkdepends=[A dependency for running tests of the package'\''s upstream project]:CHECKDEPENDS:_default' \
'--pgpsig=[The base64-encoded OpenPGP detached signature of the package file]:PGPSIG:_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-repo-desc__create__help_commands" \
"*::: :->help" \
&& ret=0

    case $state in
    (help)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:alpm-repo-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-repo-desc__help_commands" \
"*::: :->help" \
&& ret=0

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

    case $state in
    (create)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:alpm-repo-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-repo-desc_commands] )) ||
_alpm-repo-desc_commands() {
    local commands; commands=(
'create:Create a package repository desc file according to a schema' \
'validate:Validate a package repository desc file according to a schema' \
'format:Parse and output a package repository desc file in a different format' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'alpm-repo-desc commands' commands "$@"
}
(( $+functions[_alpm-repo-desc__create_commands] )) ||
_alpm-repo-desc__create_commands() {
    local commands; commands=(
'v1:Create a package repository desc version 1 file' \
'v2:Create a package repository desc version 2 file' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'alpm-repo-desc create commands' commands "$@"
}
(( $+functions[_alpm-repo-desc__create__help_commands] )) ||
_alpm-repo-desc__create__help_commands() {
    local commands; commands=(
'v1:Create a package repository desc version 1 file' \
'v2:Create a package repository desc version 2 file' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'alpm-repo-desc create help commands' commands "$@"
}
(( $+functions[_alpm-repo-desc__create__help__help_commands] )) ||
_alpm-repo-desc__create__help__help_commands() {
    local commands; commands=()
    _describe -t commands 'alpm-repo-desc create help help commands' commands "$@"
}
(( $+functions[_alpm-repo-desc__create__help__v1_commands] )) ||
_alpm-repo-desc__create__help__v1_commands() {
    local commands; commands=()
    _describe -t commands 'alpm-repo-desc create help v1 commands' commands "$@"
}
(( $+functions[_alpm-repo-desc__create__help__v2_commands] )) ||
_alpm-repo-desc__create__help__v2_commands() {
    local commands; commands=()
    _describe -t commands 'alpm-repo-desc create help v2 commands' commands "$@"
}
(( $+functions[_alpm-repo-desc__create__v1_commands] )) ||
_alpm-repo-desc__create__v1_commands() {
    local commands; commands=()
    _describe -t commands 'alpm-repo-desc create v1 commands' commands "$@"
}
(( $+functions[_alpm-repo-desc__create__v2_commands] )) ||
_alpm-repo-desc__create__v2_commands() {
    local commands; commands=()
    _describe -t commands 'alpm-repo-desc create v2 commands' commands "$@"
}
(( $+functions[_alpm-repo-desc__format_commands] )) ||
_alpm-repo-desc__format_commands() {
    local commands; commands=()
    _describe -t commands 'alpm-repo-desc format commands' commands "$@"
}
(( $+functions[_alpm-repo-desc__help_commands] )) ||
_alpm-repo-desc__help_commands() {
    local commands; commands=(
'create:Create a package repository desc file according to a schema' \
'validate:Validate a package repository desc file according to a schema' \
'format:Parse and output a package repository desc file in a different format' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'alpm-repo-desc help commands' commands "$@"
}
(( $+functions[_alpm-repo-desc__help__create_commands] )) ||
_alpm-repo-desc__help__create_commands() {
    local commands; commands=(
'v1:Create a package repository desc version 1 file' \
'v2:Create a package repository desc version 2 file' \
    )
    _describe -t commands 'alpm-repo-desc help create commands' commands "$@"
}
(( $+functions[_alpm-repo-desc__help__create__v1_commands] )) ||
_alpm-repo-desc__help__create__v1_commands() {
    local commands; commands=()
    _describe -t commands 'alpm-repo-desc help create v1 commands' commands "$@"
}
(( $+functions[_alpm-repo-desc__help__create__v2_commands] )) ||
_alpm-repo-desc__help__create__v2_commands() {
    local commands; commands=()
    _describe -t commands 'alpm-repo-desc help create v2 commands' commands "$@"
}
(( $+functions[_alpm-repo-desc__help__format_commands] )) ||
_alpm-repo-desc__help__format_commands() {
    local commands; commands=()
    _describe -t commands 'alpm-repo-desc help format commands' commands "$@"
}
(( $+functions[_alpm-repo-desc__help__help_commands] )) ||
_alpm-repo-desc__help__help_commands() {
    local commands; commands=()
    _describe -t commands 'alpm-repo-desc help help commands' commands "$@"
}
(( $+functions[_alpm-repo-desc__help__validate_commands] )) ||
_alpm-repo-desc__help__validate_commands() {
    local commands; commands=()
    _describe -t commands 'alpm-repo-desc help validate commands' commands "$@"
}
(( $+functions[_alpm-repo-desc__validate_commands] )) ||
_alpm-repo-desc__validate_commands() {
    local commands; commands=()
    _describe -t commands 'alpm-repo-desc validate commands' commands "$@"
}

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