#compdef alpm-pkginfo

autoload -U is-at-least

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

    case $state in
    (create)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:alpm-pkginfo-create-command-$line[1]:"
        case $line[1] in
            (v1)
_arguments "${_arguments_options[@]}" : \
'--pkgname=[The pkgname to use in the PKGINFO]:PKGNAME:_default' \
'--pkgbase=[The pkgbase to use in the PKGINFO]:PKGBASE:_default' \
'--pkgver=[The pkgver to use in the PKGINFO]:PKGVER:_default' \
'--pkgdesc=[The package description to use in the PKGINFO]:PKGDESC:_default' \
'--url=[Provide a url]:URL:_default' \
'--builddate=[Provide a builddate]:BUILDDATE:_default' \
'--packager=[Provide a packager]:PACKAGER:_default' \
'--size=[Provide a size]:SIZE:_default' \
'--arch=[Provide a architecture]:ARCH:_default' \
'*--license=[Provide one or more licenses]:LICENSE:_default' \
'*--replaces=[Provide one or more replaces]:REPLACES:_default' \
'*--group=[Provide one or more groups]:GROUP:_default' \
'*--conflict=[Provide one or more conflicts]:CONFLICT:_default' \
'*--provides=[Provide one or more provides]:PROVIDES:_default' \
'*--backup=[Provide one or more backups]:BACKUP:_default' \
'*--depend=[Provide one or more depends]:DEPEND:_default' \
'*--optdepend=[Provide one or more optdepend]:OPTDEPEND:_default' \
'*--makedepend=[Provide one or more makedepend]:MAKEDEPEND:_default' \
'*--checkdepend=[Provide one or more checkdepend]:CHECKDEPEND:_default' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'::output -- An optional custom file to write to:_default' \
&& ret=0
;;
(v2)
_arguments "${_arguments_options[@]}" : \
'--pkgname=[The pkgname to use in the PKGINFO]:PKGNAME:_default' \
'--pkgbase=[The pkgbase to use in the PKGINFO]:PKGBASE:_default' \
'--pkgver=[The pkgver to use in the PKGINFO]:PKGVER:_default' \
'--pkgdesc=[The package description to use in the PKGINFO]:PKGDESC:_default' \
'--url=[Provide a url]:URL:_default' \
'--builddate=[Provide a builddate]:BUILDDATE:_default' \
'--packager=[Provide a packager]:PACKAGER:_default' \
'--size=[Provide a size]:SIZE:_default' \
'--arch=[Provide a architecture]:ARCH:_default' \
'*--license=[Provide one or more licenses]:LICENSE:_default' \
'*--replaces=[Provide one or more replaces]:REPLACES:_default' \
'*--group=[Provide one or more groups]:GROUP:_default' \
'*--conflict=[Provide one or more conflicts]:CONFLICT:_default' \
'*--provides=[Provide one or more provides]:PROVIDES:_default' \
'*--backup=[Provide one or more backups]:BACKUP:_default' \
'*--depend=[Provide one or more depends]:DEPEND:_default' \
'*--optdepend=[Provide one or more optdepend]:OPTDEPEND:_default' \
'*--makedepend=[Provide one or more makedepend]:MAKEDEPEND:_default' \
'*--checkdepend=[Provide one or more checkdepend]:CHECKDEPEND:_default' \
'*--xdata=[Provide one or more Xdata]:XDATA:_default' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'::output -- An optional custom file to write to:_default' \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
":: :_alpm-pkginfo__create__help_commands" \
"*::: :->help" \
&& ret=0

    case $state in
    (help)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:alpm-pkginfo-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 PKGINFO schema version to use]:VERSION:_default' \
'--schema=[Provide the PKGINFO schema version to use]:VERSION:_default' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'::file -- An optional input file path to read from:_files' \
&& ret=0
;;
(format)
_arguments "${_arguments_options[@]}" : \
'-s+[Provide the PKGINFO schema version to use]:VERSION:_default' \
'--schema=[Provide the PKGINFO schema version to use]:VERSION:_default' \
'-o+[The output format to use]:OUTPUT_FORMAT:((json\:"The JSON output format"))' \
'--output-format=[The output format to use]: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 -- An optional input file path to read from:_files' \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
":: :_alpm-pkginfo__help_commands" \
"*::: :->help" \
&& ret=0

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

    case $state in
    (create)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:alpm-pkginfo-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-pkginfo_commands] )) ||
_alpm-pkginfo_commands() {
    local commands; commands=(
'create:Create a PKGINFO file according to a schema' \
'validate:Validate a PKGINFO file' \
'format:Parse a PKGINFO file and output it in a different file format' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'alpm-pkginfo commands' commands "$@"
}
(( $+functions[_alpm-pkginfo__create_commands] )) ||
_alpm-pkginfo__create_commands() {
    local commands; commands=(
'v1:Create a PKGINFO version 1 file' \
'v2:Create a PKGINFO version 2 file' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'alpm-pkginfo create commands' commands "$@"
}
(( $+functions[_alpm-pkginfo__create__help_commands] )) ||
_alpm-pkginfo__create__help_commands() {
    local commands; commands=(
'v1:Create a PKGINFO version 1 file' \
'v2:Create a PKGINFO version 2 file' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'alpm-pkginfo create help commands' commands "$@"
}
(( $+functions[_alpm-pkginfo__create__help__help_commands] )) ||
_alpm-pkginfo__create__help__help_commands() {
    local commands; commands=()
    _describe -t commands 'alpm-pkginfo create help help commands' commands "$@"
}
(( $+functions[_alpm-pkginfo__create__help__v1_commands] )) ||
_alpm-pkginfo__create__help__v1_commands() {
    local commands; commands=()
    _describe -t commands 'alpm-pkginfo create help v1 commands' commands "$@"
}
(( $+functions[_alpm-pkginfo__create__help__v2_commands] )) ||
_alpm-pkginfo__create__help__v2_commands() {
    local commands; commands=()
    _describe -t commands 'alpm-pkginfo create help v2 commands' commands "$@"
}
(( $+functions[_alpm-pkginfo__create__v1_commands] )) ||
_alpm-pkginfo__create__v1_commands() {
    local commands; commands=()
    _describe -t commands 'alpm-pkginfo create v1 commands' commands "$@"
}
(( $+functions[_alpm-pkginfo__create__v2_commands] )) ||
_alpm-pkginfo__create__v2_commands() {
    local commands; commands=()
    _describe -t commands 'alpm-pkginfo create v2 commands' commands "$@"
}
(( $+functions[_alpm-pkginfo__format_commands] )) ||
_alpm-pkginfo__format_commands() {
    local commands; commands=()
    _describe -t commands 'alpm-pkginfo format commands' commands "$@"
}
(( $+functions[_alpm-pkginfo__help_commands] )) ||
_alpm-pkginfo__help_commands() {
    local commands; commands=(
'create:Create a PKGINFO file according to a schema' \
'validate:Validate a PKGINFO file' \
'format:Parse a PKGINFO file and output it in a different file format' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'alpm-pkginfo help commands' commands "$@"
}
(( $+functions[_alpm-pkginfo__help__create_commands] )) ||
_alpm-pkginfo__help__create_commands() {
    local commands; commands=(
'v1:Create a PKGINFO version 1 file' \
'v2:Create a PKGINFO version 2 file' \
    )
    _describe -t commands 'alpm-pkginfo help create commands' commands "$@"
}
(( $+functions[_alpm-pkginfo__help__create__v1_commands] )) ||
_alpm-pkginfo__help__create__v1_commands() {
    local commands; commands=()
    _describe -t commands 'alpm-pkginfo help create v1 commands' commands "$@"
}
(( $+functions[_alpm-pkginfo__help__create__v2_commands] )) ||
_alpm-pkginfo__help__create__v2_commands() {
    local commands; commands=()
    _describe -t commands 'alpm-pkginfo help create v2 commands' commands "$@"
}
(( $+functions[_alpm-pkginfo__help__format_commands] )) ||
_alpm-pkginfo__help__format_commands() {
    local commands; commands=()
    _describe -t commands 'alpm-pkginfo help format commands' commands "$@"
}
(( $+functions[_alpm-pkginfo__help__help_commands] )) ||
_alpm-pkginfo__help__help_commands() {
    local commands; commands=()
    _describe -t commands 'alpm-pkginfo help help commands' commands "$@"
}
(( $+functions[_alpm-pkginfo__help__validate_commands] )) ||
_alpm-pkginfo__help__validate_commands() {
    local commands; commands=()
    _describe -t commands 'alpm-pkginfo help validate commands' commands "$@"
}
(( $+functions[_alpm-pkginfo__validate_commands] )) ||
_alpm-pkginfo__validate_commands() {
    local commands; commands=()
    _describe -t commands 'alpm-pkginfo validate commands' commands "$@"
}

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