#compdef procscope

_procscope() {
    local -a commands
    local -a flags

    flags=(
        '(-p --pid)'{-p,--pid}'[Attach to existing process by PID]:pid:_pids'
        '(-n --name)'{-n,--name}'[Attach to process by name]:name:_process_names'
        '(-o --out)'{-o,--out}'[Evidence bundle output directory]:dir:_directories'
        '--jsonl[Write events as JSONL to file]:file:_files'
        '--summary[Write Markdown summary to file]:file:_files'
        '--no-color[Disable colored output]'
        '(-q --quiet)'{-q,--quiet}'[Suppress live timeline]'
        '--max-args[Maximum argv elements]:number:'
        '--max-path[Maximum path length]:number:'
        '--skip-checks[Skip privilege checks]'
        '--version[Show version]'
        '--help[Show help]'
    )

    commands=(
        'completion:Generate shell completion scripts'
    )

    _arguments -s "${flags[@]}" \
        '1: :->command' \
        '*:: :->args'

    case $state in
        command)
            _describe 'command' commands
            ;;
    esac
}

_procscope
