#compdef badness

autoload -U is-at-least

_badness() {
    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[@]}" : \
'(--no-config)--config=[Path to a \`badness.toml\` to use instead of discovering one. Applies to \`format\` and \`lint\`; ignored by \`parse\`, \`lsp\`, and \`init\`]:PATH:_files' \
'--color=[When to use color in output]:WHEN:((auto\:"Colorize when writing to a terminal and \`NO_COLOR\` is unset (default)"
always\:"Always colorize"
never\:"Never colorize"))' \
'--no-config[Ignore any \`badness.toml\` (project, \`\$BADNESS_CONFIG\`, or global) and use built-in defaults]' \
'-q[Suppress non-essential output (errors are still shown). Under \`format --check\` this drops the per-file diff, leaving the list of files that would be reformatted and the summary]' \
'--quiet[Suppress non-essential output (errors are still shown). Under \`format --check\` this drops the per-file diff, leaving the list of files that would be reformatted and the summary]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'-V[Print version]' \
'--version[Print version]' \
":: :_badness_commands" \
"*::: :->badness" \
&& ret=0
    case $state in
    (badness)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:badness-command-$line[1]:"
        case $line[1] in
            (format)
_arguments "${_arguments_options[@]}" : \
'--stdin-filepath=[Name the stdin buffer so its language is dispatched by extension (\`.bib\` → BibTeX, anything else → LaTeX). No file is read or written; only the extension is used. Ignored when paths are given]:PATH:_files' \
'--line-width=[Maximum line width before the formatter breaks a line; 0 disables width-based wrapping]:LINE_WIDTH:_default' \
'--indent-width=[Number of spaces per indent step]:INDENT_WIDTH:_default' \
'--item-indent=[How to indent continuation lines in list items]:ITEM_INDENT:((hang\:"Align continuations under the body following a bare \`\\item \` (default)"
indent\:"Indent continuations by one indent-width step"
none\:"Align continuations with the \`\\item\` command"))' \
'--wrap=[How to lay out line breaks inside a paragraph]:WRAP:((reflow\:"Greedy fill\: wrap words to the line width (default)"
stable\:"Preserve acceptable authored breaks and rebalance only nearby text (revision-stable wrapping)"
sentence\:"One sentence per line (line width ignored)"
semantic\:"Semantic line breaks (sembr.org)\: keep authored breaks, add sentence breaks, and wrap overlong lines to the line width"
preserve\:"Leave authored line breaks untouched"))' \
'--math-wrap=[How to lay out line breaks inside display math]:MATH_WRAP:((auto\:"Derive from the effective wrap mode\: preserve → preserve, else break (default)"
preserve\:"Keep authored line breaks inside display-math bodies"
single-line\:"Never insert breaks; a long body overflows the line width"
break\:"Break a too-long body before its top-level operators (amsmath style)"))' \
'--line-ending=[How to spell the line breaks in the formatted output]:LINE_ENDING:((auto\:"Keep the endings the file was written with (default)"
lf\:"Always LF (\`\\n\`)"
crlf\:"Always CRLF (\`\\r\\n\`)"
native\:"The platform'\''s convention\: CRLF on Windows, LF elsewhere"))' \
'*--exclude=[Gitignore-style pattern to skip during directory discovery (repeatable). Added on top of any \`exclude\`/\`extend-exclude\` from \`badness.toml\`]:PATTERN:_default' \
'(--no-config)--config=[Path to a \`badness.toml\` to use instead of discovering one. Applies to \`format\` and \`lint\`; ignored by \`parse\`, \`lsp\`, and \`init\`]:PATH:_files' \
'--color=[When to use color in output]:WHEN:((auto\:"Colorize when writing to a terminal and \`NO_COLOR\` is unset (default)"
always\:"Always colorize"
never\:"Never colorize"))' \
'--check[Report which files would change without writing them. Exits non-zero if any file is not already formatted. Requires path arguments\: there is no file on disk to report on when reading stdin]' \
'--force-exclude[Apply exclude patterns to files named explicitly on the command line too (they are normally always processed). For runners like pre-commit that pass staged files as arguments]' \
'--no-config[Ignore any \`badness.toml\` (project, \`\$BADNESS_CONFIG\`, or global) and use built-in defaults]' \
'-q[Suppress non-essential output (errors are still shown). Under \`format --check\` this drops the per-file diff, leaving the list of files that would be reformatted and the summary]' \
'--quiet[Suppress non-essential output (errors are still shown). Under \`format --check\` this drops the per-file diff, leaving the list of files that would be reformatted and the summary]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'*::paths -- Files or directories to format. Pass `-` for stdin, which is also read when paths are omitted and stdin is not a terminal:_files' \
&& ret=0
;;
(lint)
_arguments "${_arguments_options[@]}" : \
'--stdin-filepath=[Name the stdin buffer so its language is dispatched by extension (\`.bib\` → BibTeX, anything else → LaTeX). No file is read or written; only the extension is used. Ignored when paths are given]:PATH:_files' \
'*--exclude=[Gitignore-style pattern to skip during directory discovery (repeatable). Added on top of any \`exclude\`/\`extend-exclude\` from \`badness.toml\`]:PATTERN:_default' \
'*--select=[Run only these rules (repeatable). Overrides \`\[lint\] select\` from \`badness.toml\` when given]:RULE:_default' \
'*--ignore=[Disable these rules (repeatable). Overrides \`\[lint\] ignore\` from \`badness.toml\` when given]:RULE:_default' \
'--explain=[Print the description and examples for a rule id, then exit. Ignores paths, config, and fixes]:RULE:_default' \
'--output=[Output format for findings. The human modes write to stderr; \`json\` writes to stdout]:OUTPUT:((pretty\:"Source-snippet output with caret spans, on stderr (default)"
concise\:"One \`path\:line\:col\: severity \[rule\] message\` line per finding, on stderr"
json\:"A machine-readable JSON array of findings on stdout (\`\[\]\` when clean), with byte-offset ranges and fix data"))' \
'(--no-config)--config=[Path to a \`badness.toml\` to use instead of discovering one. Applies to \`format\` and \`lint\`; ignored by \`parse\`, \`lsp\`, and \`init\`]:PATH:_files' \
'--color=[When to use color in output]:WHEN:((auto\:"Colorize when writing to a terminal and \`NO_COLOR\` is unset (default)"
always\:"Always colorize"
never\:"Never colorize"))' \
'--fix[Apply safe autofixes in place, then report what remains. Requires path arguments; has no effect on stdin (there is nothing to write)]' \
'--unsafe-fixes[Also apply fixes that may change typeset output (requires \`--fix\`)]' \
'--force-exclude[Apply exclude patterns to files named explicitly on the command line too (they are normally always processed). For runners like pre-commit that pass staged files as arguments]' \
'--no-config[Ignore any \`badness.toml\` (project, \`\$BADNESS_CONFIG\`, or global) and use built-in defaults]' \
'-q[Suppress non-essential output (errors are still shown). Under \`format --check\` this drops the per-file diff, leaving the list of files that would be reformatted and the summary]' \
'--quiet[Suppress non-essential output (errors are still shown). Under \`format --check\` this drops the per-file diff, leaving the list of files that would be reformatted and the summary]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'*::paths -- Files or directories to lint. Pass `-` for stdin, which is also read when paths are omitted and stdin is not a terminal:_files' \
&& ret=0
;;
(parse)
_arguments "${_arguments_options[@]}" : \
'(--no-config)--config=[Path to a \`badness.toml\` to use instead of discovering one. Applies to \`format\` and \`lint\`; ignored by \`parse\`, \`lsp\`, and \`init\`]:PATH:_files' \
'--color=[When to use color in output]:WHEN:((auto\:"Colorize when writing to a terminal and \`NO_COLOR\` is unset (default)"
always\:"Always colorize"
never\:"Never colorize"))' \
'--no-config[Ignore any \`badness.toml\` (project, \`\$BADNESS_CONFIG\`, or global) and use built-in defaults]' \
'-q[Suppress non-essential output (errors are still shown). Under \`format --check\` this drops the per-file diff, leaving the list of files that would be reformatted and the summary]' \
'--quiet[Suppress non-essential output (errors are still shown). Under \`format --check\` this drops the per-file diff, leaving the list of files that would be reformatted and the summary]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'::path -- File to parse. Pass `-` for stdin, which is also read when the path is omitted and stdin is not a terminal:_files' \
&& ret=0
;;
(lsp)
_arguments "${_arguments_options[@]}" : \
'(--no-config)--config=[Path to a \`badness.toml\` to use instead of discovering one. Applies to \`format\` and \`lint\`; ignored by \`parse\`, \`lsp\`, and \`init\`]:PATH:_files' \
'--color=[When to use color in output]:WHEN:((auto\:"Colorize when writing to a terminal and \`NO_COLOR\` is unset (default)"
always\:"Always colorize"
never\:"Never colorize"))' \
'--no-config[Ignore any \`badness.toml\` (project, \`\$BADNESS_CONFIG\`, or global) and use built-in defaults]' \
'-q[Suppress non-essential output (errors are still shown). Under \`format --check\` this drops the per-file diff, leaving the list of files that would be reformatted and the summary]' \
'--quiet[Suppress non-essential output (errors are still shown). Under \`format --check\` this drops the per-file diff, leaving the list of files that would be reformatted and the summary]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
&& ret=0
;;
(inverse-search)
_arguments "${_arguments_options[@]}" : \
'-i+[The \`.tex\` file the viewer resolved]:PATH:_files' \
'--input=[The \`.tex\` file the viewer resolved]:PATH:_files' \
'(--line0)-l+[Line number, counting from 1 — what SyncTeX-aware viewers emit]:LINE:_default' \
'(--line0)--line=[Line number, counting from 1 — what SyncTeX-aware viewers emit]:LINE:_default' \
'--line0=[Line number counting from 0, for a viewer that reports it that way]:LINE:_default' \
'--character=[Column, counting from 0, when the viewer supplies one]:COLUMN:_default' \
'--ipc-dir=[Directory holding the servers'\'' IPC advertisements. Defaults to \`\$BADNESS_IPC_DIR\`, then a per-user directory under the runtime (or temporary) directory]:DIR:_files' \
'(--no-config)--config=[Path to a \`badness.toml\` to use instead of discovering one. Applies to \`format\` and \`lint\`; ignored by \`parse\`, \`lsp\`, and \`init\`]:PATH:_files' \
'--color=[When to use color in output]:WHEN:((auto\:"Colorize when writing to a terminal and \`NO_COLOR\` is unset (default)"
always\:"Always colorize"
never\:"Never colorize"))' \
'--no-config[Ignore any \`badness.toml\` (project, \`\$BADNESS_CONFIG\`, or global) and use built-in defaults]' \
'-q[Suppress non-essential output (errors are still shown). Under \`format --check\` this drops the per-file diff, leaving the list of files that would be reformatted and the summary]' \
'--quiet[Suppress non-essential output (errors are still shown). Under \`format --check\` this drops the per-file diff, leaving the list of files that would be reformatted and the summary]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
&& ret=0
;;
(init)
_arguments "${_arguments_options[@]}" : \
'(--no-config)--config=[Path to a \`badness.toml\` to use instead of discovering one. Applies to \`format\` and \`lint\`; ignored by \`parse\`, \`lsp\`, and \`init\`]:PATH:_files' \
'--color=[When to use color in output]:WHEN:((auto\:"Colorize when writing to a terminal and \`NO_COLOR\` is unset (default)"
always\:"Always colorize"
never\:"Never colorize"))' \
'--force[Overwrite an existing \`badness.toml\`]' \
'--no-config[Ignore any \`badness.toml\` (project, \`\$BADNESS_CONFIG\`, or global) and use built-in defaults]' \
'-q[Suppress non-essential output (errors are still shown). Under \`format --check\` this drops the per-file diff, leaving the list of files that would be reformatted and the summary]' \
'--quiet[Suppress non-essential output (errors are still shown). Under \`format --check\` this drops the per-file diff, leaving the list of files that would be reformatted and the summary]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
&& ret=0
;;
(debug)
_arguments "${_arguments_options[@]}" : \
'(--no-config)--config=[Path to a \`badness.toml\` to use instead of discovering one. Applies to \`format\` and \`lint\`; ignored by \`parse\`, \`lsp\`, and \`init\`]:PATH:_files' \
'--color=[When to use color in output]:WHEN:((auto\:"Colorize when writing to a terminal and \`NO_COLOR\` is unset (default)"
always\:"Always colorize"
never\:"Never colorize"))' \
'--no-config[Ignore any \`badness.toml\` (project, \`\$BADNESS_CONFIG\`, or global) and use built-in defaults]' \
'-q[Suppress non-essential output (errors are still shown). Under \`format --check\` this drops the per-file diff, leaving the list of files that would be reformatted and the summary]' \
'--quiet[Suppress non-essential output (errors are still shown). Under \`format --check\` this drops the per-file diff, leaving the list of files that would be reformatted and the summary]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
":: :_badness__subcmd__debug_commands" \
"*::: :->debug" \
&& ret=0

    case $state in
    (debug)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:badness-debug-command-$line[1]:"
        case $line[1] in
            (format)
_arguments "${_arguments_options[@]}" : \
'--checks=[Which invariant checks to run]:CHECKS:((idempotency\:"Only the formatter fixed-point check\: \`fmt(fmt(x)) == fmt(x)\`"
losslessness\:"Only the parser round-trip check\: \`reconstruct(x) == x\`"
trivia\:"Only the trivia-convergence oracle\: every TeX-identical newline<->space perturbation of the input must format to a fixed point (\`fmt(fmt(p)) == fmt(p)\`) upholding the invariants. Wrap is pinned to \`reflow\` (\`--wrap\` ignored); \`.bib\` files are skipped. Deliberately *not* part of \`all\` — the smoke-test workflow'\''s failure classes stay as they are"
trivia-strict\:"Only the strict trivia-invariance oracle\: \`fmt(perturbed) == fmt(original)\` for every perturbation. This is the *end-state* contract, so it still fails wherever the formatter deliberately preserves an authored break — it is a survey for finding layout decisions that read the lone-newline predicate, not a gate. Same wrap pin and \`.bib\` skip as \`trivia\`, and likewise not part of \`all\`"
all\:"Losslessness and idempotency (default). Does not include either trivia check"))' \
'--line-width=[Maximum line width before the formatter breaks a line (overrides config; the multi-width corpus sweep'\''s knob). Use 0 to disable width-based wrapping]:LINE_WIDTH:_default' \
'--wrap=[How to lay out line breaks inside a paragraph (the trivia checks ignore this and pin \`reflow\`)]:WRAP:((reflow\:"Greedy fill\: wrap words to the line width (default)"
stable\:"Preserve acceptable authored breaks and rebalance only nearby text (revision-stable wrapping)"
sentence\:"One sentence per line (line width ignored)"
semantic\:"Semantic line breaks (sembr.org)\: keep authored breaks, add sentence breaks, and wrap overlong lines to the line width"
preserve\:"Leave authored line breaks untouched"))' \
'--dump-dir=[Directory where per-pass artifacts are written on failure]:DIR:_files' \
'*--exclude=[Gitignore-style pattern to skip during directory discovery (repeatable). Added on top of any \`exclude\`/\`extend-exclude\` from \`badness.toml\`]:PATTERN:_default' \
'(--no-config)--config=[Path to a \`badness.toml\` to use instead of discovering one. Applies to \`format\` and \`lint\`; ignored by \`parse\`, \`lsp\`, and \`init\`]:PATH:_files' \
'--color=[When to use color in output]:WHEN:((auto\:"Colorize when writing to a terminal and \`NO_COLOR\` is unset (default)"
always\:"Always colorize"
never\:"Never colorize"))' \
'--report[Emit a Markdown report to stdout instead of log lines]' \
'--dump-passes[Write pass artifacts even when all checks pass]' \
'--force-exclude[Apply exclude patterns to files named explicitly on the command line too (they are normally always processed)]' \
'--no-config[Ignore any \`badness.toml\` (project, \`\$BADNESS_CONFIG\`, or global) and use built-in defaults]' \
'-q[Suppress non-essential output (errors are still shown). Under \`format --check\` this drops the per-file diff, leaving the list of files that would be reformatted and the summary]' \
'--quiet[Suppress non-essential output (errors are still shown). Under \`format --check\` this drops the per-file diff, leaving the list of files that would be reformatted and the summary]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'*::paths -- Files or directories to check:_files' \
&& ret=0
;;
(echo-args)
_arguments "${_arguments_options[@]}" : \
'--out=[File to write the arguments to]:FILE:_files' \
'(--no-config)--config=[Path to a \`badness.toml\` to use instead of discovering one. Applies to \`format\` and \`lint\`; ignored by \`parse\`, \`lsp\`, and \`init\`]:PATH:_files' \
'--color=[When to use color in output]:WHEN:((auto\:"Colorize when writing to a terminal and \`NO_COLOR\` is unset (default)"
always\:"Always colorize"
never\:"Never colorize"))' \
'--no-config[Ignore any \`badness.toml\` (project, \`\$BADNESS_CONFIG\`, or global) and use built-in defaults]' \
'-q[Suppress non-essential output (errors are still shown). Under \`format --check\` this drops the per-file diff, leaving the list of files that would be reformatted and the summary]' \
'--quiet[Suppress non-essential output (errors are still shown). Under \`format --check\` this drops the per-file diff, leaving the list of files that would be reformatted and the summary]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'*::args -- The arguments to record. Taken verbatim, so a leading `-` or a `%` placeholder is never interpreted:_default' \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" : \
":: :_badness__subcmd__debug__subcmd__help_commands" \
"*::: :->help" \
&& ret=0

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

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

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

(( $+functions[_badness_commands] )) ||
_badness_commands() {
    local commands; commands=(
'format:Format LaTeX source' \
'lint:Lint LaTeX source, reporting parse diagnostics' \
'parse:Parse LaTeX source and print its concrete syntax tree (CST)' \
'lsp:Run the language server over stdio' \
'inverse-search:Answer a PDF viewer'\''s inverse (backward) search' \
'init:Write a commented starter \`badness.toml\` to the current directory' \
'debug:Debug utilities for parser and formatter diagnostics, and test scaffolding' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'badness commands' commands "$@"
}
(( $+functions[_badness__subcmd__debug_commands] )) ||
_badness__subcmd__debug_commands() {
    local commands; commands=(
'format:Check formatter and parser invariants per file, writing nothing back' \
'echo-args:Write the trailing arguments to a file, one per line, and exit 0' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'badness debug commands' commands "$@"
}
(( $+functions[_badness__subcmd__debug__subcmd__echo-args_commands] )) ||
_badness__subcmd__debug__subcmd__echo-args_commands() {
    local commands; commands=()
    _describe -t commands 'badness debug echo-args commands' commands "$@"
}
(( $+functions[_badness__subcmd__debug__subcmd__format_commands] )) ||
_badness__subcmd__debug__subcmd__format_commands() {
    local commands; commands=()
    _describe -t commands 'badness debug format commands' commands "$@"
}
(( $+functions[_badness__subcmd__debug__subcmd__help_commands] )) ||
_badness__subcmd__debug__subcmd__help_commands() {
    local commands; commands=(
'format:Check formatter and parser invariants per file, writing nothing back' \
'echo-args:Write the trailing arguments to a file, one per line, and exit 0' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'badness debug help commands' commands "$@"
}
(( $+functions[_badness__subcmd__debug__subcmd__help__subcmd__echo-args_commands] )) ||
_badness__subcmd__debug__subcmd__help__subcmd__echo-args_commands() {
    local commands; commands=()
    _describe -t commands 'badness debug help echo-args commands' commands "$@"
}
(( $+functions[_badness__subcmd__debug__subcmd__help__subcmd__format_commands] )) ||
_badness__subcmd__debug__subcmd__help__subcmd__format_commands() {
    local commands; commands=()
    _describe -t commands 'badness debug help format commands' commands "$@"
}
(( $+functions[_badness__subcmd__debug__subcmd__help__subcmd__help_commands] )) ||
_badness__subcmd__debug__subcmd__help__subcmd__help_commands() {
    local commands; commands=()
    _describe -t commands 'badness debug help help commands' commands "$@"
}
(( $+functions[_badness__subcmd__format_commands] )) ||
_badness__subcmd__format_commands() {
    local commands; commands=()
    _describe -t commands 'badness format commands' commands "$@"
}
(( $+functions[_badness__subcmd__help_commands] )) ||
_badness__subcmd__help_commands() {
    local commands; commands=(
'format:Format LaTeX source' \
'lint:Lint LaTeX source, reporting parse diagnostics' \
'parse:Parse LaTeX source and print its concrete syntax tree (CST)' \
'lsp:Run the language server over stdio' \
'inverse-search:Answer a PDF viewer'\''s inverse (backward) search' \
'init:Write a commented starter \`badness.toml\` to the current directory' \
'debug:Debug utilities for parser and formatter diagnostics, and test scaffolding' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'badness help commands' commands "$@"
}
(( $+functions[_badness__subcmd__help__subcmd__debug_commands] )) ||
_badness__subcmd__help__subcmd__debug_commands() {
    local commands; commands=(
'format:Check formatter and parser invariants per file, writing nothing back' \
'echo-args:Write the trailing arguments to a file, one per line, and exit 0' \
    )
    _describe -t commands 'badness help debug commands' commands "$@"
}
(( $+functions[_badness__subcmd__help__subcmd__debug__subcmd__echo-args_commands] )) ||
_badness__subcmd__help__subcmd__debug__subcmd__echo-args_commands() {
    local commands; commands=()
    _describe -t commands 'badness help debug echo-args commands' commands "$@"
}
(( $+functions[_badness__subcmd__help__subcmd__debug__subcmd__format_commands] )) ||
_badness__subcmd__help__subcmd__debug__subcmd__format_commands() {
    local commands; commands=()
    _describe -t commands 'badness help debug format commands' commands "$@"
}
(( $+functions[_badness__subcmd__help__subcmd__format_commands] )) ||
_badness__subcmd__help__subcmd__format_commands() {
    local commands; commands=()
    _describe -t commands 'badness help format commands' commands "$@"
}
(( $+functions[_badness__subcmd__help__subcmd__help_commands] )) ||
_badness__subcmd__help__subcmd__help_commands() {
    local commands; commands=()
    _describe -t commands 'badness help help commands' commands "$@"
}
(( $+functions[_badness__subcmd__help__subcmd__init_commands] )) ||
_badness__subcmd__help__subcmd__init_commands() {
    local commands; commands=()
    _describe -t commands 'badness help init commands' commands "$@"
}
(( $+functions[_badness__subcmd__help__subcmd__inverse-search_commands] )) ||
_badness__subcmd__help__subcmd__inverse-search_commands() {
    local commands; commands=()
    _describe -t commands 'badness help inverse-search commands' commands "$@"
}
(( $+functions[_badness__subcmd__help__subcmd__lint_commands] )) ||
_badness__subcmd__help__subcmd__lint_commands() {
    local commands; commands=()
    _describe -t commands 'badness help lint commands' commands "$@"
}
(( $+functions[_badness__subcmd__help__subcmd__lsp_commands] )) ||
_badness__subcmd__help__subcmd__lsp_commands() {
    local commands; commands=()
    _describe -t commands 'badness help lsp commands' commands "$@"
}
(( $+functions[_badness__subcmd__help__subcmd__parse_commands] )) ||
_badness__subcmd__help__subcmd__parse_commands() {
    local commands; commands=()
    _describe -t commands 'badness help parse commands' commands "$@"
}
(( $+functions[_badness__subcmd__init_commands] )) ||
_badness__subcmd__init_commands() {
    local commands; commands=()
    _describe -t commands 'badness init commands' commands "$@"
}
(( $+functions[_badness__subcmd__inverse-search_commands] )) ||
_badness__subcmd__inverse-search_commands() {
    local commands; commands=()
    _describe -t commands 'badness inverse-search commands' commands "$@"
}
(( $+functions[_badness__subcmd__lint_commands] )) ||
_badness__subcmd__lint_commands() {
    local commands; commands=()
    _describe -t commands 'badness lint commands' commands "$@"
}
(( $+functions[_badness__subcmd__lsp_commands] )) ||
_badness__subcmd__lsp_commands() {
    local commands; commands=()
    _describe -t commands 'badness lsp commands' commands "$@"
}
(( $+functions[_badness__subcmd__parse_commands] )) ||
_badness__subcmd__parse_commands() {
    local commands; commands=()
    _describe -t commands 'badness parse commands' commands "$@"
}

if [ "$funcstack[1]" = "_badness" ]; then
    _badness "$@"
else
    compdef _badness badness
fi
