#compdef cmakefmt

autoload -U is-at-least

_cmakefmt() {
    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[@]}" : \
'*--files-from=[Read more formatting targets from a file, or \`-\` for stdin]:PATH:_default' \
'--path-regex=[Filter recursively discovered CMake paths with a regex]:REGEX:_default' \
'*--ignore-path=[Add one or more extra ignore files during recursive discovery]:PATH:_files' \
'--cache-location=[Override the cache directory used by \`--cache\`]:PATH:_files' \
'--cache-strategy=[Choose whether cache invalidation tracks file metadata or file contents]:CACHE_STRATEGY:((metadata\:"Use file size and modification time to detect cache invalidation"
content\:"Hash file contents to detect cache invalidation"))' \
'--since=[Git base ref used together with \`--changed\`]:REF:_default' \
'--stdin-path=[Virtual path used for config discovery and diagnostics when reading stdin]:PATH:_files' \
'*--lines=[Restrict formatting to one or more 1-based inclusive line ranges]:START:END:_default' \
'--report-format=[Choose the output report format]:REPORT_FORMAT:((human\:"Human-friendly terminal output"
json\:"Machine-readable JSON output"
github\:"GitHub Actions workflow commands"
checkstyle\:"Checkstyle XML"
junit\:"JUnit XML"
sarif\:"SARIF JSON"
edit\:"Editor-friendly JSON with byte-range replacements"))' \
'--color=[Control ANSI color output]:COLOR:((auto\:"Use colour only when stdout looks like an interactive terminal"
always\:"Always emit ANSI colour codes"
never\:"Never emit ANSI colour codes"))' \
'-j+[Set the number of parallel formatting jobs]::JOBS:_default' \
'--parallel=[Set the number of parallel formatting jobs]::JOBS:_default' \
'*-c+[Use one or more explicit config files instead of config discovery]:PATH:_files' \
'*--config-file=[Use one or more explicit config files instead of config discovery]:PATH:_files' \
'*--config=[Use one or more explicit config files instead of config discovery]:PATH:_files' \
'-l+[Override the maximum line width]:LINE_WIDTH:_default' \
'--line-width=[Override the maximum line width]:LINE_WIDTH:_default' \
'--tab-size=[Override the number of spaces per indent level]:TAB_SIZE:_default' \
'--command-case=[Normalise command name case (lower, upper, unchanged)]:COMMAND_CASE:((lower\:"Force lowercase output"
upper\:"Force uppercase output"
unchanged\:"Preserve the original source casing"))' \
'--keyword-case=[Normalise keyword case (lower, upper, unchanged)]:KEYWORD_CASE:((lower\:"Force lowercase output"
upper\:"Force uppercase output"
unchanged\:"Preserve the original source casing"))' \
'--dangle-parens=[Place closing paren on its own line when wrapping]:DANGLE_PARENS:(true false)' \
'--required-version=[Refuse to run unless the current cmakefmt version matches exactly]:VERSION:_default' \
'(--list-changed-files --list-input-files)-i[Rewrite files on disk instead of printing formatted output]' \
'(--list-changed-files --list-input-files)--in-place[Rewrite files on disk instead of printing formatted output]' \
'(--list-input-files)--check[Exit with code 1 if any selected file would change]' \
'(-q --quiet --list-input-files)--list-changed-files[Print only the files that would change, without modifying them]' \
'(--check --list-changed-files -i --in-place -d --diff -q --quiet)--list-input-files[Print the selected input files after discovery/filtering, without formatting them]' \
'(--check -i --in-place -d --diff --list-changed-files --list-input-files --explain --watch -q --quiet -p --progress-bar)--list-unknown-commands[List commands that don'\''t match any built-in or user-defined spec]' \
'--no-gitignore[Ignore \`.gitignore\` files during recursive discovery]' \
'--sorted[Sort discovered files by path before processing]' \
'--generate-man-page[Generate a roff man page and print it to stdout]' \
'--debug[Print detailed discovery, config, and formatter diagnostics to stderr]' \
'(-q --quiet)-s[Show a per-file status summary instead of formatted output]' \
'(-q --quiet)--summary[Show a per-file status summary instead of formatted output]' \
'-q[Suppress per-file output and emit only end-of-run summaries]' \
'--quiet[Suppress per-file output and emit only end-of-run summaries]' \
'--stat[Print a git-style summary after formatting (e.g. "3 files changed, 12 lines reformatted")]' \
'--keep-going[Continue processing other files after a file-level parse or format error]' \
'(-i --in-place)-d[Print a unified diff instead of the full formatted output]' \
'(-i --in-place)--diff[Print a unified diff instead of the full formatted output]' \
'(--check -i --in-place -d --diff --list-changed-files --list-input-files -q --quiet -p --progress-bar)--explain[Show why each command was formatted the way it was]' \
'(--check -d --diff --list-changed-files --list-input-files -q --quiet --explain -p --progress-bar)--watch[Watch for file changes and reformat automatically]' \
'--cache[Cache formatted results for repeated runs on the same files]' \
'(--staged)--changed[Select modified Git-tracked files instead of explicit input paths]' \
'(--changed)--staged[Select staged Git-tracked files instead of explicit input paths]' \
'-p[Show a progress bar on stderr while processing files]' \
'--progress-bar[Show a progress bar on stderr while processing files]' \
'--no-config[Disable config discovery and ignore explicit config files]' \
'--no-editorconfig[Disable \`.editorconfig\` fallback]' \
'(--no-verify)--verify[Verify that formatting preserves the parsed CMake semantics]' \
'(--verify)--no-verify[Skip semantic verification, even for in-place rewrites]' \
'(--verify)--fast[Skip semantic verification, even for in-place rewrites]' \
'--require-pragma[Format only files that opt in with a \`# cmakefmt\: enable\` style pragma]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'-V[Print version]' \
'--version[Print version]' \
'::files -- Files or directories to format. Use `-` for stdin:_default' \
":: :_cmakefmt_commands" \
"*::: :->cmakefmt" \
&& ret=0
    case $state in
    (cmakefmt)
        words=($line[2] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:cmakefmt-command-$line[2]:"
        case $line[2] in
            (lsp)
_arguments "${_arguments_options[@]}" : \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(completions)
_arguments "${_arguments_options[@]}" : \
'-h[Print help]' \
'--help[Print help]' \
':shell -- The shell to generate completions for:(bash elvish fish powershell zsh)' \
&& ret=0
;;
(install-hook)
_arguments "${_arguments_options[@]}" : \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(config)
_arguments "${_arguments_options[@]}" : \
'-h[Print help]' \
'--help[Print help]' \
":: :_cmakefmt__subcmd__config_commands" \
"*::: :->config" \
&& ret=0

    case $state in
    (config)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:cmakefmt-config-command-$line[1]:"
        case $line[1] in
            (dump)
_arguments "${_arguments_options[@]}" : \
'--format=[Output format]:FORMAT:((yaml\:"Emit YAML"
toml\:"Emit TOML"))' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
&& ret=0
;;
(schema)
_arguments "${_arguments_options[@]}" : \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(check)
_arguments "${_arguments_options[@]}" : \
'-h[Print help]' \
'--help[Print help]' \
'::path -- Config file to validate (discovers automatically if omitted):_default' \
&& ret=0
;;
(show)
_arguments "${_arguments_options[@]}" : \
'--format=[Output format]:FORMAT:((yaml\:"Emit YAML"
toml\:"Emit TOML"))' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'::path -- Target file for config resolution:_default' \
&& ret=0
;;
(path)
_arguments "${_arguments_options[@]}" : \
'-h[Print help]' \
'--help[Print help]' \
'::path -- Target file for config resolution:_default' \
&& ret=0
;;
(explain)
_arguments "${_arguments_options[@]}" : \
'-h[Print help]' \
'--help[Print help]' \
'::path -- Target file for config resolution:_default' \
&& ret=0
;;
(convert)
_arguments "${_arguments_options[@]}" : \
'--format=[Output format]:FORMAT:((yaml\:"Emit YAML"
toml\:"Emit TOML"))' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'*::paths -- Legacy config file(s) to convert:_files' \
&& ret=0
;;
(init)
_arguments "${_arguments_options[@]}" : \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
":: :_cmakefmt__subcmd__config__subcmd__help_commands" \
"*::: :->help" \
&& ret=0

    case $state in
    (help)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:cmakefmt-config-help-command-$line[1]:"
        case $line[1] in
            (dump)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(schema)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(check)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(show)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(path)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(explain)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(convert)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(init)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
        esac
    ;;
esac
;;
        esac
    ;;
esac
;;
(dump)
_arguments "${_arguments_options[@]}" : \
'-h[Print help]' \
'--help[Print help]' \
'::file -- Input file to dump (reads stdin if omitted):_files' \
":: :_cmakefmt__subcmd__dump_commands" \
"*::: :->dump" \
&& ret=0

    case $state in
    (dump)
        words=($line[2] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:cmakefmt-dump-command-$line[2]:"
        case $line[2] in
            (ast)
_arguments "${_arguments_options[@]}" : \
'-h[Print help]' \
'--help[Print help]' \
'::file -- Input file to dump (reads stdin if omitted):_files' \
&& ret=0
;;
(parse)
_arguments "${_arguments_options[@]}" : \
'-h[Print help]' \
'--help[Print help]' \
'::file -- Input file to dump (reads stdin if omitted):_files' \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
":: :_cmakefmt__subcmd__dump__subcmd__help_commands" \
"*::: :->help" \
&& ret=0

    case $state in
    (help)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:cmakefmt-dump-help-command-$line[1]:"
        case $line[1] in
            (ast)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(parse)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
        esac
    ;;
esac
;;
        esac
    ;;
esac
;;
(help)
_arguments "${_arguments_options[@]}" : \
":: :_cmakefmt__subcmd__help_commands" \
"*::: :->help" \
&& ret=0

    case $state in
    (help)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:cmakefmt-help-command-$line[1]:"
        case $line[1] in
            (lsp)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(completions)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(install-hook)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(config)
_arguments "${_arguments_options[@]}" : \
":: :_cmakefmt__subcmd__help__subcmd__config_commands" \
"*::: :->config" \
&& ret=0

    case $state in
    (config)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:cmakefmt-help-config-command-$line[1]:"
        case $line[1] in
            (dump)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(schema)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(check)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(show)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(path)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(explain)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(convert)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
(init)
_arguments "${_arguments_options[@]}" : \
&& ret=0
;;
        esac
    ;;
esac
;;
(dump)
_arguments "${_arguments_options[@]}" : \
":: :_cmakefmt__subcmd__help__subcmd__dump_commands" \
"*::: :->dump" \
&& ret=0

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

(( $+functions[_cmakefmt_commands] )) ||
_cmakefmt_commands() {
    local commands; commands=(
'lsp:Start the cmakefmt LSP server (reads/writes JSON-RPC on stdio)' \
'completions:Generate shell completion scripts and print them to stdout' \
'install-hook:Install a git pre-commit hook that runs \`cmakefmt --check\` on staged CMake files' \
'config:Config inspection, generation, and conversion' \
'dump:Dump internal representations (AST, parse tree) for debugging' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'cmakefmt commands' commands "$@"
}
(( $+functions[_cmakefmt__subcmd__completions_commands] )) ||
_cmakefmt__subcmd__completions_commands() {
    local commands; commands=()
    _describe -t commands 'cmakefmt completions commands' commands "$@"
}
(( $+functions[_cmakefmt__subcmd__config_commands] )) ||
_cmakefmt__subcmd__config_commands() {
    local commands; commands=(
'dump:Print the default config template' \
'schema:Print the JSON Schema for the config file' \
'check:Validate a config file without formatting' \
'show:Print the effective config for a target' \
'path:Print the config file path selected for a target' \
'explain:Explain config resolution for a target or the current directory' \
'convert:Convert legacy cmake-format config files' \
'init:Write a starter \`.cmakefmt.yaml\` to the current directory' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'cmakefmt config commands' commands "$@"
}
(( $+functions[_cmakefmt__subcmd__config__subcmd__check_commands] )) ||
_cmakefmt__subcmd__config__subcmd__check_commands() {
    local commands; commands=()
    _describe -t commands 'cmakefmt config check commands' commands "$@"
}
(( $+functions[_cmakefmt__subcmd__config__subcmd__convert_commands] )) ||
_cmakefmt__subcmd__config__subcmd__convert_commands() {
    local commands; commands=()
    _describe -t commands 'cmakefmt config convert commands' commands "$@"
}
(( $+functions[_cmakefmt__subcmd__config__subcmd__dump_commands] )) ||
_cmakefmt__subcmd__config__subcmd__dump_commands() {
    local commands; commands=()
    _describe -t commands 'cmakefmt config dump commands' commands "$@"
}
(( $+functions[_cmakefmt__subcmd__config__subcmd__explain_commands] )) ||
_cmakefmt__subcmd__config__subcmd__explain_commands() {
    local commands; commands=()
    _describe -t commands 'cmakefmt config explain commands' commands "$@"
}
(( $+functions[_cmakefmt__subcmd__config__subcmd__help_commands] )) ||
_cmakefmt__subcmd__config__subcmd__help_commands() {
    local commands; commands=(
'dump:Print the default config template' \
'schema:Print the JSON Schema for the config file' \
'check:Validate a config file without formatting' \
'show:Print the effective config for a target' \
'path:Print the config file path selected for a target' \
'explain:Explain config resolution for a target or the current directory' \
'convert:Convert legacy cmake-format config files' \
'init:Write a starter \`.cmakefmt.yaml\` to the current directory' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'cmakefmt config help commands' commands "$@"
}
(( $+functions[_cmakefmt__subcmd__config__subcmd__help__subcmd__check_commands] )) ||
_cmakefmt__subcmd__config__subcmd__help__subcmd__check_commands() {
    local commands; commands=()
    _describe -t commands 'cmakefmt config help check commands' commands "$@"
}
(( $+functions[_cmakefmt__subcmd__config__subcmd__help__subcmd__convert_commands] )) ||
_cmakefmt__subcmd__config__subcmd__help__subcmd__convert_commands() {
    local commands; commands=()
    _describe -t commands 'cmakefmt config help convert commands' commands "$@"
}
(( $+functions[_cmakefmt__subcmd__config__subcmd__help__subcmd__dump_commands] )) ||
_cmakefmt__subcmd__config__subcmd__help__subcmd__dump_commands() {
    local commands; commands=()
    _describe -t commands 'cmakefmt config help dump commands' commands "$@"
}
(( $+functions[_cmakefmt__subcmd__config__subcmd__help__subcmd__explain_commands] )) ||
_cmakefmt__subcmd__config__subcmd__help__subcmd__explain_commands() {
    local commands; commands=()
    _describe -t commands 'cmakefmt config help explain commands' commands "$@"
}
(( $+functions[_cmakefmt__subcmd__config__subcmd__help__subcmd__help_commands] )) ||
_cmakefmt__subcmd__config__subcmd__help__subcmd__help_commands() {
    local commands; commands=()
    _describe -t commands 'cmakefmt config help help commands' commands "$@"
}
(( $+functions[_cmakefmt__subcmd__config__subcmd__help__subcmd__init_commands] )) ||
_cmakefmt__subcmd__config__subcmd__help__subcmd__init_commands() {
    local commands; commands=()
    _describe -t commands 'cmakefmt config help init commands' commands "$@"
}
(( $+functions[_cmakefmt__subcmd__config__subcmd__help__subcmd__path_commands] )) ||
_cmakefmt__subcmd__config__subcmd__help__subcmd__path_commands() {
    local commands; commands=()
    _describe -t commands 'cmakefmt config help path commands' commands "$@"
}
(( $+functions[_cmakefmt__subcmd__config__subcmd__help__subcmd__schema_commands] )) ||
_cmakefmt__subcmd__config__subcmd__help__subcmd__schema_commands() {
    local commands; commands=()
    _describe -t commands 'cmakefmt config help schema commands' commands "$@"
}
(( $+functions[_cmakefmt__subcmd__config__subcmd__help__subcmd__show_commands] )) ||
_cmakefmt__subcmd__config__subcmd__help__subcmd__show_commands() {
    local commands; commands=()
    _describe -t commands 'cmakefmt config help show commands' commands "$@"
}
(( $+functions[_cmakefmt__subcmd__config__subcmd__init_commands] )) ||
_cmakefmt__subcmd__config__subcmd__init_commands() {
    local commands; commands=()
    _describe -t commands 'cmakefmt config init commands' commands "$@"
}
(( $+functions[_cmakefmt__subcmd__config__subcmd__path_commands] )) ||
_cmakefmt__subcmd__config__subcmd__path_commands() {
    local commands; commands=()
    _describe -t commands 'cmakefmt config path commands' commands "$@"
}
(( $+functions[_cmakefmt__subcmd__config__subcmd__schema_commands] )) ||
_cmakefmt__subcmd__config__subcmd__schema_commands() {
    local commands; commands=()
    _describe -t commands 'cmakefmt config schema commands' commands "$@"
}
(( $+functions[_cmakefmt__subcmd__config__subcmd__show_commands] )) ||
_cmakefmt__subcmd__config__subcmd__show_commands() {
    local commands; commands=()
    _describe -t commands 'cmakefmt config show commands' commands "$@"
}
(( $+functions[_cmakefmt__subcmd__dump_commands] )) ||
_cmakefmt__subcmd__dump_commands() {
    local commands; commands=(
'ast:Print the raw parser AST as a tree' \
'parse:Print the formatted parse tree (not yet implemented)' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'cmakefmt dump commands' commands "$@"
}
(( $+functions[_cmakefmt__subcmd__dump__subcmd__ast_commands] )) ||
_cmakefmt__subcmd__dump__subcmd__ast_commands() {
    local commands; commands=()
    _describe -t commands 'cmakefmt dump ast commands' commands "$@"
}
(( $+functions[_cmakefmt__subcmd__dump__subcmd__help_commands] )) ||
_cmakefmt__subcmd__dump__subcmd__help_commands() {
    local commands; commands=(
'ast:Print the raw parser AST as a tree' \
'parse:Print the formatted parse tree (not yet implemented)' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'cmakefmt dump help commands' commands "$@"
}
(( $+functions[_cmakefmt__subcmd__dump__subcmd__help__subcmd__ast_commands] )) ||
_cmakefmt__subcmd__dump__subcmd__help__subcmd__ast_commands() {
    local commands; commands=()
    _describe -t commands 'cmakefmt dump help ast commands' commands "$@"
}
(( $+functions[_cmakefmt__subcmd__dump__subcmd__help__subcmd__help_commands] )) ||
_cmakefmt__subcmd__dump__subcmd__help__subcmd__help_commands() {
    local commands; commands=()
    _describe -t commands 'cmakefmt dump help help commands' commands "$@"
}
(( $+functions[_cmakefmt__subcmd__dump__subcmd__help__subcmd__parse_commands] )) ||
_cmakefmt__subcmd__dump__subcmd__help__subcmd__parse_commands() {
    local commands; commands=()
    _describe -t commands 'cmakefmt dump help parse commands' commands "$@"
}
(( $+functions[_cmakefmt__subcmd__dump__subcmd__parse_commands] )) ||
_cmakefmt__subcmd__dump__subcmd__parse_commands() {
    local commands; commands=()
    _describe -t commands 'cmakefmt dump parse commands' commands "$@"
}
(( $+functions[_cmakefmt__subcmd__help_commands] )) ||
_cmakefmt__subcmd__help_commands() {
    local commands; commands=(
'lsp:Start the cmakefmt LSP server (reads/writes JSON-RPC on stdio)' \
'completions:Generate shell completion scripts and print them to stdout' \
'install-hook:Install a git pre-commit hook that runs \`cmakefmt --check\` on staged CMake files' \
'config:Config inspection, generation, and conversion' \
'dump:Dump internal representations (AST, parse tree) for debugging' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'cmakefmt help commands' commands "$@"
}
(( $+functions[_cmakefmt__subcmd__help__subcmd__completions_commands] )) ||
_cmakefmt__subcmd__help__subcmd__completions_commands() {
    local commands; commands=()
    _describe -t commands 'cmakefmt help completions commands' commands "$@"
}
(( $+functions[_cmakefmt__subcmd__help__subcmd__config_commands] )) ||
_cmakefmt__subcmd__help__subcmd__config_commands() {
    local commands; commands=(
'dump:Print the default config template' \
'schema:Print the JSON Schema for the config file' \
'check:Validate a config file without formatting' \
'show:Print the effective config for a target' \
'path:Print the config file path selected for a target' \
'explain:Explain config resolution for a target or the current directory' \
'convert:Convert legacy cmake-format config files' \
'init:Write a starter \`.cmakefmt.yaml\` to the current directory' \
    )
    _describe -t commands 'cmakefmt help config commands' commands "$@"
}
(( $+functions[_cmakefmt__subcmd__help__subcmd__config__subcmd__check_commands] )) ||
_cmakefmt__subcmd__help__subcmd__config__subcmd__check_commands() {
    local commands; commands=()
    _describe -t commands 'cmakefmt help config check commands' commands "$@"
}
(( $+functions[_cmakefmt__subcmd__help__subcmd__config__subcmd__convert_commands] )) ||
_cmakefmt__subcmd__help__subcmd__config__subcmd__convert_commands() {
    local commands; commands=()
    _describe -t commands 'cmakefmt help config convert commands' commands "$@"
}
(( $+functions[_cmakefmt__subcmd__help__subcmd__config__subcmd__dump_commands] )) ||
_cmakefmt__subcmd__help__subcmd__config__subcmd__dump_commands() {
    local commands; commands=()
    _describe -t commands 'cmakefmt help config dump commands' commands "$@"
}
(( $+functions[_cmakefmt__subcmd__help__subcmd__config__subcmd__explain_commands] )) ||
_cmakefmt__subcmd__help__subcmd__config__subcmd__explain_commands() {
    local commands; commands=()
    _describe -t commands 'cmakefmt help config explain commands' commands "$@"
}
(( $+functions[_cmakefmt__subcmd__help__subcmd__config__subcmd__init_commands] )) ||
_cmakefmt__subcmd__help__subcmd__config__subcmd__init_commands() {
    local commands; commands=()
    _describe -t commands 'cmakefmt help config init commands' commands "$@"
}
(( $+functions[_cmakefmt__subcmd__help__subcmd__config__subcmd__path_commands] )) ||
_cmakefmt__subcmd__help__subcmd__config__subcmd__path_commands() {
    local commands; commands=()
    _describe -t commands 'cmakefmt help config path commands' commands "$@"
}
(( $+functions[_cmakefmt__subcmd__help__subcmd__config__subcmd__schema_commands] )) ||
_cmakefmt__subcmd__help__subcmd__config__subcmd__schema_commands() {
    local commands; commands=()
    _describe -t commands 'cmakefmt help config schema commands' commands "$@"
}
(( $+functions[_cmakefmt__subcmd__help__subcmd__config__subcmd__show_commands] )) ||
_cmakefmt__subcmd__help__subcmd__config__subcmd__show_commands() {
    local commands; commands=()
    _describe -t commands 'cmakefmt help config show commands' commands "$@"
}
(( $+functions[_cmakefmt__subcmd__help__subcmd__dump_commands] )) ||
_cmakefmt__subcmd__help__subcmd__dump_commands() {
    local commands; commands=(
'ast:Print the raw parser AST as a tree' \
'parse:Print the formatted parse tree (not yet implemented)' \
    )
    _describe -t commands 'cmakefmt help dump commands' commands "$@"
}
(( $+functions[_cmakefmt__subcmd__help__subcmd__dump__subcmd__ast_commands] )) ||
_cmakefmt__subcmd__help__subcmd__dump__subcmd__ast_commands() {
    local commands; commands=()
    _describe -t commands 'cmakefmt help dump ast commands' commands "$@"
}
(( $+functions[_cmakefmt__subcmd__help__subcmd__dump__subcmd__parse_commands] )) ||
_cmakefmt__subcmd__help__subcmd__dump__subcmd__parse_commands() {
    local commands; commands=()
    _describe -t commands 'cmakefmt help dump parse commands' commands "$@"
}
(( $+functions[_cmakefmt__subcmd__help__subcmd__help_commands] )) ||
_cmakefmt__subcmd__help__subcmd__help_commands() {
    local commands; commands=()
    _describe -t commands 'cmakefmt help help commands' commands "$@"
}
(( $+functions[_cmakefmt__subcmd__help__subcmd__install-hook_commands] )) ||
_cmakefmt__subcmd__help__subcmd__install-hook_commands() {
    local commands; commands=()
    _describe -t commands 'cmakefmt help install-hook commands' commands "$@"
}
(( $+functions[_cmakefmt__subcmd__help__subcmd__lsp_commands] )) ||
_cmakefmt__subcmd__help__subcmd__lsp_commands() {
    local commands; commands=()
    _describe -t commands 'cmakefmt help lsp commands' commands "$@"
}
(( $+functions[_cmakefmt__subcmd__install-hook_commands] )) ||
_cmakefmt__subcmd__install-hook_commands() {
    local commands; commands=()
    _describe -t commands 'cmakefmt install-hook commands' commands "$@"
}
(( $+functions[_cmakefmt__subcmd__lsp_commands] )) ||
_cmakefmt__subcmd__lsp_commands() {
    local commands; commands=()
    _describe -t commands 'cmakefmt lsp commands' commands "$@"
}

if [ "$funcstack[1]" = "_cmakefmt" ]; then
    _cmakefmt "$@"
else
    compdef _cmakefmt cmakefmt
fi
