#compdef batless

autoload -U is-at-least

_batless() {
    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[@]}" : \
'--language=[Language for syntax highlighting (auto-detect if not specified)]:LANGUAGE:_default' \
'--max-lines=[Limit lines shown]:MAX_LINES:_default' \
'--max-bytes=[Limit bytes shown]:MAX_BYTES:_default' \
'--mode=[Output mode]:MODE:(plain highlight json summary)' \
'--color=[Color output control]:COLOR:(auto always never)' \
'--theme=[Theme for syntax highlighting]:THEME:_default' \
'--summary-level=[Summary level\: control detail level of summary output]:SUMMARY_LEVEL:((none\:"No summary, show full file"
minimal\:"Minimal summary with only critical structures"
standard\:"Standard summary with most important code"
detailed\:"Detailed summary with comprehensive information"))' \
'--ai-model=[AI model for token counting]:AI_MODEL:((gpt4\:"OpenAI GPT-4 family"
gpt4-turbo\:"OpenAI GPT-4 Turbo with enhanced capabilities"
gpt35\:"OpenAI GPT-3.5 family"
claude\:"Anthropic Claude family"
claude35-sonnet\:"Anthropic Claude-3.5 Sonnet with enhanced capabilities"
generic\:"Generic model estimation"))' \
'--prompt-tokens=[Estimate prompt token overhead when fitting context]:PROMPT_TOKENS:_default' \
'--get-schema=[Get JSON schema for specified output format]:GET_SCHEMA:_default' \
'--generate-completions=[Generate shell completions for the specified shell]:GENERATE_COMPLETIONS:(bash zsh fish power-shell)' \
'--profile=[Use predefined AI tool profile (overrides other settings)]:PROFILE:((claude\:"Optimized for Claude'\''s context window (4K lines, summary mode)"
copilot\:"Focused on code suggestions for GitHub Copilot (2K lines, tokens included)"
chatgpt\:"OpenAI ChatGPT optimizations (3K lines, JSON output)"
assistant\:"General AI assistant profile (5K lines, balanced output)"))' \
'--custom-profile=[Load custom AI profile from file]:CUSTOM_PROFILE:_default' \
'--config=[Configuration file path (defaults to auto-discovery)]:CONFIG:_default' \
'--streaming-chunk-size=[Chunk size for streaming output (in lines)]:STREAMING_CHUNK_SIZE:_default' \
'--checkpoint=[Checkpoint file path for resuming]:CHECKPOINT:_default' \
'--edit-profile=[Edit existing custom profile]:EDIT_PROFILE:_default' \
'--strip-ansi[Strip ANSI escape codes from output]' \
'--list-languages[List all supported languages]' \
'--list-themes[List all available themes]' \
'--include-tokens[Include tokens in JSON output (AI-friendly)]' \
'--summary[Summary mode\: show only important code structures (deprecated, use --summary-level)]' \
'--count-tokens[Count tokens for AI model context estimation]' \
'--fit-context[Fit content within AI model context window (truncate if needed)]' \
'--validate-json[Validate JSON output against schema]' \
'--streaming-json[Enable streaming JSON output for large files]' \
'--enable-resume[Enable resume capability with checkpoint support]' \
'--configure[Run interactive configuration wizard]' \
'--list-profiles[List available custom profiles]' \
'--debug[Enable debug mode with detailed processing information]' \
'--plain[PAGER compatibility\: equivalent to --mode plain (for cat replacement)]' \
'-u[PAGER compatibility\: ignored for compatibility with other pagers]' \
'--unbuffered[PAGER compatibility\: ignored for compatibility with other pagers]' \
'-n[CAT compatibility\: show line numbers (like cat -n)]' \
'--number[CAT compatibility\: show line numbers (like cat -n)]' \
'-b[CAT compatibility\: number non-blank output lines (like cat -b)]' \
'--number-nonblank[CAT compatibility\: number non-blank output lines (like cat -b)]' \
'--no-title[PAGER compatibility\: ignored for compatibility with less (no title bar)]' \
'--version-json[Output version information as machine-readable JSON]' \
'--json-pretty[Pretty-print JSON output (when --mode=json); does not affect streaming]' \
'-h[Print help (see more with '\''--help'\'')]' \
'--help[Print help (see more with '\''--help'\'')]' \
'-V[Print version]' \
'--version[Print version]' \
'::file -- File to view:_default' \
&& ret=0
}

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

if [ "$funcstack[1]" = "_batless" ]; then
    _batless "$@"
else
    compdef _batless batless
fi
