#compdef arch-rebuild-order

autoload -U is-at-least

_arch-rebuild-order() {
    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[@]}" : \
'*--repos=[Repositories]:REPOS: ' \
'--dbpath=[The path to the pacman database, default ( /var/lib/pacman )]:DBPATH: ' \
'-d+[Write a dotfile into the given file]:DOTFILE: ' \
'--dotfile=[Write a dotfile into the given file]:DOTFILE: ' \
'--no-reverse-depends[Only use the pkgnames provided as input]' \
'--with-check-depends[Include checkdepends]' \
'-h[Print help]' \
'--help[Print help]' \
'*::pkgnames -- List of input packages:' \
&& ret=0
}

(( $+functions[_arch-rebuild-order_commands] )) ||
_arch-rebuild-order_commands() {
    local commands; commands=()
    _describe -t commands 'arch-rebuild-order commands' commands "$@"
}

if [ "$funcstack[1]" = "_arch-rebuild-order" ]; then
    _arch-rebuild-order "$@"
else
    compdef _arch-rebuild-order arch-rebuild-order
fi
