#compdef zizmor

autoload -U is-at-least

_zizmor() {
    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[@]}" : \
'--persona=[The persona to use while auditing]:PERSONA:((auditor\:"The "auditor" persona (false positives OK)"
pedantic\:"The "pedantic" persona (code smells OK)"
regular\:"The "regular" persona (minimal false positives)"))' \
'--gh-token=[The GitHub API token to use]:GH_TOKEN:_default' \
'--gh-hostname=[The GitHub Server Hostname. Defaults to github.com]:GH_HOSTNAME:_default' \
'--format=[The output format to emit. By default, cargo-style diagnostics will be emitted]:FORMAT:((plain\:"cargo-style output"
json\:"JSON-formatted output (currently v1)"
json-v1\:""v1" JSON format"
sarif\:"SARIF-formatted output"
github\:"GitHub Actions workflow command-formatted output"))' \
'--color=[Control the use of color in output]:MODE:((auto\:"Use color output if the output supports it"
always\:"Force color output, even if the output isn'\''t a terminal"
never\:"Disable color output, even if the output is a compatible terminal"))' \
'-c+[The configuration file to load. This loads a single configuration file across all input groups, which may not be what you intend]:CONFIG:_default' \
'--config=[The configuration file to load. This loads a single configuration file across all input groups, which may not be what you intend]:CONFIG:_default' \
'--min-severity=[Filter all results below this severity]:MIN_SEVERITY:(informational low medium high)' \
'--min-confidence=[Filter all results below this confidence]:MIN_CONFIDENCE:(low medium high)' \
'--cache-dir=[The directory to use for HTTP caching. By default, a host-appropriate user-caching directory will be used]:CACHE_DIR:_default' \
'*--collect=[Control which kinds of inputs are collected for auditing]:COLLECT:((all\:"Collect all possible inputs, ignoring \`.gitignore\` files"
default\:"Collect all possible inputs, respecting \`.gitignore\` files"
workflows\:"Collect workflows"
actions\:"Collect action definitions (i.e. \`action.yml\`)"
dependabot\:"Collect Dependabot configuration files (i.e. \`dependabot.yml\`)"))' \
'--completions=[Generate tab completion scripts for the specified shell]:SHELL:((bash\:"Bourne Again \`SHell\` (bash)"
elvish\:"Elvish shell"
fish\:"Friendly Interactive \`SHell\` (fish)"
nushell\:"Nushell"
powershell\:"\`PowerShell\`"
zsh\:"Z \`SHell\` (zsh)"))' \
'--fix=[Fix findings automatically, when available (EXPERIMENTAL)]' \
'--lsp[Run in language server mode (EXPERIMENTAL)]' \
'--stdio[]' \
'-p[Emit '\''pedantic'\'' findings]' \
'--pedantic[Emit '\''pedantic'\'' findings]' \
'-o[Perform only offline operations]' \
'--offline[Perform only offline operations]' \
'--no-online-audits[Perform only offline audits]' \
'*-v[Increase logging verbosity]' \
'*--verbose[Increase logging verbosity]' \
'(-v --verbose)*-q[Decrease logging verbosity]' \
'(-v --verbose)*--quiet[Decrease logging verbosity]' \
'--no-progress[Don'\''t show progress bars, even if the terminal supports them]' \
'--no-config[Disable all configuration loading]' \
'--no-exit-codes[Disable all error codes besides success and tool failure]' \
'--strict-collection[Fail instead of warning on syntax and schema errors in collected inputs]' \
'--naches[Enable naches mode]' \
'--thanks[Emit thank-you messages for zizmor'\''s sponsors]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'-V[Print version]' \
'--version[Print version]' \
'*::inputs -- The inputs to audit:_default' \
&& ret=0
}

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

if [ "$funcstack[1]" = "_zizmor" ]; then
    _zizmor "$@"
else
    compdef _zizmor zizmor
fi
