#compdef hexapoda

autoload -U is-at-least

_hexapoda() {
    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+[specify a file to use for configuration]:file:_files' \
'--config=[specify a file to use for configuration]:file:_files' \
'-s[print the path to the config file]' \
'--show-config-path[print the path to the config file]' \
'-h[Print help]' \
'--help[Print help]' \
'-V[Print version]' \
'--version[Print version]' \
'*::files -- the input files to edit:_files' \
&& ret=0
}

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

if [ "$funcstack[1]" = "_hexapoda" ]; then
    _hexapoda "$@"
else
    compdef _hexapoda hexapoda
fi
