lexd 0.8.8

Command-line interface for the lex format
Documentation
#compdef lex

autoload -U is-at-least

_lex() {
    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[@]}" : \
'--list-transforms[List available transforms]' \
'-h[Print help]' \
'--help[Print help]' \
'-V[Print version]' \
'--version[Print version]' \
'::path -- Path to the lex file:_files' \
'::transform -- Transform to apply (stage-format, e.g., '\''ast-tag'\'', '\''token-core-json'\''):(token-core-json token-core-simple token-core-pprint token-simple token-pprint token-line-json token-line-simple token-line-pprint ir-json ast-json ast-tag ast-treeviz)' \
&& ret=0
}

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

if [ "$funcstack[1]" = "_lex" ]; then
    _lex "$@"
else
    compdef _lex lex
fi