#compdef panache

autoload -U is-at-least

_panache() {
    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[@]}" : \
'--config=[Path to configuration file]:CONFIG:_files' \
'--stdin-filename=[Synthetic filename for stdin input (used for flavor detection)]:PATH:_files' \
'--color=[Control when colored output is used]:WHEN:(auto always never)' \
'--cache-dir=[Path to the cache directory (overrides config cache-dir)]:CACHE_DIR:_files' \
'-j+[Worker threads for multi-file format/lint (0 = auto, 1 = serial)]:N:_default' \
'--jobs=[Worker threads for multi-file format/lint (0 = auto, 1 = serial)]:N:_default' \
'--no-color[Disable colored output (equivalent to --color never)]' \
'-q[Suppress informational and diagnostic output (errors and primary results still print)]' \
'--quiet[Suppress informational and diagnostic output (errors and primary results still print)]' \
'--isolated[Ignore all discovered configuration files]' \
'--no-cache[Disable all lint/format cache reads and writes for this run]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'-V[Print version]' \
'--version[Print version]' \
":: :_panache_commands" \
"*::: :->panache" \
&& ret=0
    case $state in
    (panache)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:panache-command-$line[1]:"
        case $line[1] in
            (format)
_arguments "${_arguments_options[@]}" : \
'--range=[Format only lines START\:END (e.g., --range 5\:10) \[Experimental\]]:START:END:_default' \
'--config=[Path to configuration file]:CONFIG:_files' \
'--stdin-filename=[Synthetic filename for stdin input (used for flavor detection)]:PATH:_files' \
'--color=[Control when colored output is used]:WHEN:(auto always never)' \
'--cache-dir=[Path to the cache directory (overrides config cache-dir)]:CACHE_DIR:_files' \
'-j+[Worker threads for multi-file format/lint (0 = auto, 1 = serial)]:N:_default' \
'--jobs=[Worker threads for multi-file format/lint (0 = auto, 1 = serial)]:N:_default' \
'--check[Check if file is formatted (exit code 1 if not)]' \
'--verify[\[Deprecated\] Verify losslessness and idempotency invariants]' \
'--force-exclude[Apply exclude patterns to explicitly provided files]' \
'--no-color[Disable colored output (equivalent to --color never)]' \
'-q[Suppress informational and diagnostic output (errors and primary results still print)]' \
'--quiet[Suppress informational and diagnostic output (errors and primary results still print)]' \
'--isolated[Ignore all discovered configuration files]' \
'--no-cache[Disable all lint/format cache reads and writes for this run]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'*::files -- Input file path(s) or directories:_files' \
&& ret=0
;;
(parse)
_arguments "${_arguments_options[@]}" : \
'--json=[Write CST JSON output to PATH]:PATH:_files' \
'--config=[Path to configuration file]:CONFIG:_files' \
'--stdin-filename=[Synthetic filename for stdin input (used for flavor detection)]:PATH:_files' \
'--color=[Control when colored output is used]:WHEN:(auto always never)' \
'--cache-dir=[Path to the cache directory (overrides config cache-dir)]:CACHE_DIR:_files' \
'-j+[Worker threads for multi-file format/lint (0 = auto, 1 = serial)]:N:_default' \
'--jobs=[Worker threads for multi-file format/lint (0 = auto, 1 = serial)]:N:_default' \
'--verify[\[Deprecated\] Verify parser losslessness invariant]' \
'--no-color[Disable colored output (equivalent to --color never)]' \
'-q[Suppress informational and diagnostic output (errors and primary results still print)]' \
'--quiet[Suppress informational and diagnostic output (errors and primary results still print)]' \
'--isolated[Ignore all discovered configuration files]' \
'--no-cache[Disable all lint/format cache reads and writes for this run]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'::file -- Input file path:_files' \
&& ret=0
;;
(lsp)
_arguments "${_arguments_options[@]}" : \
'--config=[Path to configuration file]:CONFIG:_files' \
'--stdin-filename=[Synthetic filename for stdin input (used for flavor detection)]:PATH:_files' \
'--color=[Control when colored output is used]:WHEN:(auto always never)' \
'--cache-dir=[Path to the cache directory (overrides config cache-dir)]:CACHE_DIR:_files' \
'-j+[Worker threads for multi-file format/lint (0 = auto, 1 = serial)]:N:_default' \
'--jobs=[Worker threads for multi-file format/lint (0 = auto, 1 = serial)]:N:_default' \
'--debug[Enable LSP debug logging to ~/.local/state/panache/lsp-debug.log]' \
'--no-color[Disable colored output (equivalent to --color never)]' \
'-q[Suppress informational and diagnostic output (errors and primary results still print)]' \
'--quiet[Suppress informational and diagnostic output (errors and primary results still print)]' \
'--isolated[Ignore all discovered configuration files]' \
'--no-cache[Disable all lint/format cache reads and writes for this run]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
&& ret=0
;;
(lint)
_arguments "${_arguments_options[@]}" : \
'--message-format=[Diagnostic rendering format]:MESSAGE_FORMAT:(human short)' \
'--config=[Path to configuration file]:CONFIG:_files' \
'--stdin-filename=[Synthetic filename for stdin input (used for flavor detection)]:PATH:_files' \
'--color=[Control when colored output is used]:WHEN:(auto always never)' \
'--cache-dir=[Path to the cache directory (overrides config cache-dir)]:CACHE_DIR:_files' \
'-j+[Worker threads for multi-file format/lint (0 = auto, 1 = serial)]:N:_default' \
'--jobs=[Worker threads for multi-file format/lint (0 = auto, 1 = serial)]:N:_default' \
'--check[Exit with code 1 if violations found (CI mode)]' \
'--fix[Automatically fix violations where possible]' \
'--force-exclude[Apply exclude patterns to explicitly provided files]' \
'--no-color[Disable colored output (equivalent to --color never)]' \
'-q[Suppress informational and diagnostic output (errors and primary results still print)]' \
'--quiet[Suppress informational and diagnostic output (errors and primary results still print)]' \
'--isolated[Ignore all discovered configuration files]' \
'--no-cache[Disable all lint/format cache reads and writes for this run]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'*::files -- Input file path(s) or directories:_files' \
&& ret=0
;;
(clean)
_arguments "${_arguments_options[@]}" : \
'--config=[Path to configuration file]:CONFIG:_files' \
'--stdin-filename=[Synthetic filename for stdin input (used for flavor detection)]:PATH:_files' \
'--color=[Control when colored output is used]:WHEN:(auto always never)' \
'--cache-dir=[Path to the cache directory (overrides config cache-dir)]:CACHE_DIR:_files' \
'-j+[Worker threads for multi-file format/lint (0 = auto, 1 = serial)]:N:_default' \
'--jobs=[Worker threads for multi-file format/lint (0 = auto, 1 = serial)]:N:_default' \
'--all[Remove all Panache cache buckets]' \
'--no-color[Disable colored output (equivalent to --color never)]' \
'-q[Suppress informational and diagnostic output (errors and primary results still print)]' \
'--quiet[Suppress informational and diagnostic output (errors and primary results still print)]' \
'--isolated[Ignore all discovered configuration files]' \
'--no-cache[Disable all lint/format cache reads and writes for this run]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
&& ret=0
;;
(debug)
_arguments "${_arguments_options[@]}" : \
'--config=[Path to configuration file]:CONFIG:_files' \
'--stdin-filename=[Synthetic filename for stdin input (used for flavor detection)]:PATH:_files' \
'--color=[Control when colored output is used]:WHEN:(auto always never)' \
'--cache-dir=[Path to the cache directory (overrides config cache-dir)]:CACHE_DIR:_files' \
'-j+[Worker threads for multi-file format/lint (0 = auto, 1 = serial)]:N:_default' \
'--jobs=[Worker threads for multi-file format/lint (0 = auto, 1 = serial)]:N:_default' \
'--no-color[Disable colored output (equivalent to --color never)]' \
'-q[Suppress informational and diagnostic output (errors and primary results still print)]' \
'--quiet[Suppress informational and diagnostic output (errors and primary results still print)]' \
'--isolated[Ignore all discovered configuration files]' \
'--no-cache[Disable all lint/format cache reads and writes for this run]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
":: :_panache__subcmd__debug_commands" \
"*::: :->debug" \
&& ret=0

    case $state in
    (debug)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:panache-debug-command-$line[1]:"
        case $line[1] in
            (format)
_arguments "${_arguments_options[@]}" : \
'--checks=[Which checks to run]:CHECKS:(idempotency losslessness all)' \
'--dump-dir=[Directory where failing artifacts are written]:DIR:_files' \
'--config=[Path to configuration file]:CONFIG:_files' \
'--stdin-filename=[Synthetic filename for stdin input (used for flavor detection)]:PATH:_files' \
'--color=[Control when colored output is used]:WHEN:(auto always never)' \
'--cache-dir=[Path to the cache directory (overrides config cache-dir)]:CACHE_DIR:_files' \
'-j+[Worker threads for multi-file format/lint (0 = auto, 1 = serial)]:N:_default' \
'--jobs=[Worker threads for multi-file format/lint (0 = auto, 1 = serial)]:N:_default' \
'--json[Emit JSON output for machine-readable tooling]' \
'--report[Emit Markdown report output suitable for issue descriptions]' \
'--dump-passes[Write input/parse/format pass artifacts to --dump-dir for every file]' \
'--force-exclude[Apply exclude patterns to explicitly provided files]' \
'--no-color[Disable colored output (equivalent to --color never)]' \
'-q[Suppress informational and diagnostic output (errors and primary results still print)]' \
'--quiet[Suppress informational and diagnostic output (errors and primary results still print)]' \
'--isolated[Ignore all discovered configuration files]' \
'--no-cache[Disable all lint/format cache reads and writes for this run]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'*::files -- Input file path(s) or directories:_files' \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
":: :_panache__subcmd__debug__subcmd__help_commands" \
"*::: :->help" \
&& ret=0

    case $state in
    (help)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:panache-debug-help-command-$line[1]:"
        case $line[1] in
            (format)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
        esac
    ;;
esac
;;
        esac
    ;;
esac
;;
(help)
_arguments "${_arguments_options[@]}" : \
":: :_panache__subcmd__help_commands" \
"*::: :->help" \
&& ret=0

    case $state in
    (help)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:panache-help-command-$line[1]:"
        case $line[1] in
            (format)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(parse)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(lsp)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(lint)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(clean)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(debug)
_arguments "${_arguments_options[@]}" : \
":: :_panache__subcmd__help__subcmd__debug_commands" \
"*::: :->debug" \
&& ret=0

    case $state in
    (debug)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:panache-help-debug-command-$line[1]:"
        case $line[1] in
            (format)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
        esac
    ;;
esac
;;
(help)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
        esac
    ;;
esac
;;
        esac
    ;;
esac
}

(( $+functions[_panache_commands] )) ||
_panache_commands() {
    local commands; commands=(
'format:Format a Quarto, Pandoc, or Markdown document' \
'parse:Parse and display the CST tree for debugging' \
'lsp:Start the Language Server Protocol server' \
'lint:Lint a Quarto, Pandoc, or Markdown document' \
'clean:Delete cache data' \
'debug:Debug utilities for parser/formatter diagnostics' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'panache commands' commands "$@"
}
(( $+functions[_panache__subcmd__clean_commands] )) ||
_panache__subcmd__clean_commands() {
    local commands; commands=()
    _describe -t commands 'panache clean commands' commands "$@"
}
(( $+functions[_panache__subcmd__debug_commands] )) ||
_panache__subcmd__debug_commands() {
    local commands; commands=(
'format:Run parser+formatter checks and emit diagnostics' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'panache debug commands' commands "$@"
}
(( $+functions[_panache__subcmd__debug__subcmd__format_commands] )) ||
_panache__subcmd__debug__subcmd__format_commands() {
    local commands; commands=()
    _describe -t commands 'panache debug format commands' commands "$@"
}
(( $+functions[_panache__subcmd__debug__subcmd__help_commands] )) ||
_panache__subcmd__debug__subcmd__help_commands() {
    local commands; commands=(
'format:Run parser+formatter checks and emit diagnostics' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'panache debug help commands' commands "$@"
}
(( $+functions[_panache__subcmd__debug__subcmd__help__subcmd__format_commands] )) ||
_panache__subcmd__debug__subcmd__help__subcmd__format_commands() {
    local commands; commands=()
    _describe -t commands 'panache debug help format commands' commands "$@"
}
(( $+functions[_panache__subcmd__debug__subcmd__help__subcmd__help_commands] )) ||
_panache__subcmd__debug__subcmd__help__subcmd__help_commands() {
    local commands; commands=()
    _describe -t commands 'panache debug help help commands' commands "$@"
}
(( $+functions[_panache__subcmd__format_commands] )) ||
_panache__subcmd__format_commands() {
    local commands; commands=()
    _describe -t commands 'panache format commands' commands "$@"
}
(( $+functions[_panache__subcmd__help_commands] )) ||
_panache__subcmd__help_commands() {
    local commands; commands=(
'format:Format a Quarto, Pandoc, or Markdown document' \
'parse:Parse and display the CST tree for debugging' \
'lsp:Start the Language Server Protocol server' \
'lint:Lint a Quarto, Pandoc, or Markdown document' \
'clean:Delete cache data' \
'debug:Debug utilities for parser/formatter diagnostics' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'panache help commands' commands "$@"
}
(( $+functions[_panache__subcmd__help__subcmd__clean_commands] )) ||
_panache__subcmd__help__subcmd__clean_commands() {
    local commands; commands=()
    _describe -t commands 'panache help clean commands' commands "$@"
}
(( $+functions[_panache__subcmd__help__subcmd__debug_commands] )) ||
_panache__subcmd__help__subcmd__debug_commands() {
    local commands; commands=(
'format:Run parser+formatter checks and emit diagnostics' \
    )
    _describe -t commands 'panache help debug commands' commands "$@"
}
(( $+functions[_panache__subcmd__help__subcmd__debug__subcmd__format_commands] )) ||
_panache__subcmd__help__subcmd__debug__subcmd__format_commands() {
    local commands; commands=()
    _describe -t commands 'panache help debug format commands' commands "$@"
}
(( $+functions[_panache__subcmd__help__subcmd__format_commands] )) ||
_panache__subcmd__help__subcmd__format_commands() {
    local commands; commands=()
    _describe -t commands 'panache help format commands' commands "$@"
}
(( $+functions[_panache__subcmd__help__subcmd__help_commands] )) ||
_panache__subcmd__help__subcmd__help_commands() {
    local commands; commands=()
    _describe -t commands 'panache help help commands' commands "$@"
}
(( $+functions[_panache__subcmd__help__subcmd__lint_commands] )) ||
_panache__subcmd__help__subcmd__lint_commands() {
    local commands; commands=()
    _describe -t commands 'panache help lint commands' commands "$@"
}
(( $+functions[_panache__subcmd__help__subcmd__lsp_commands] )) ||
_panache__subcmd__help__subcmd__lsp_commands() {
    local commands; commands=()
    _describe -t commands 'panache help lsp commands' commands "$@"
}
(( $+functions[_panache__subcmd__help__subcmd__parse_commands] )) ||
_panache__subcmd__help__subcmd__parse_commands() {
    local commands; commands=()
    _describe -t commands 'panache help parse commands' commands "$@"
}
(( $+functions[_panache__subcmd__lint_commands] )) ||
_panache__subcmd__lint_commands() {
    local commands; commands=()
    _describe -t commands 'panache lint commands' commands "$@"
}
(( $+functions[_panache__subcmd__lsp_commands] )) ||
_panache__subcmd__lsp_commands() {
    local commands; commands=()
    _describe -t commands 'panache lsp commands' commands "$@"
}
(( $+functions[_panache__subcmd__parse_commands] )) ||
_panache__subcmd__parse_commands() {
    local commands; commands=()
    _describe -t commands 'panache parse commands' commands "$@"
}

if [ "$funcstack[1]" = "_panache" ]; then
    _panache "$@"
else
    compdef _panache panache
fi
