#compdef rotbyte

_rotbyte() {
    _arguments \
        '--check[Force re-hash of every file]' \
        '--report[Print status report and exit]' \
        '--accept[Accept a file as correct]:file:_files' \
        '--verify-file[Verify a single file against the database]:file:_files' \
        '--accept-all[Accept all current state as baseline]' \
        '--import[Import .b2sum/.b2 hash files]' \
        '--workers[Parallel hashing workers]:count:(1 2 4 8 16)' \
        '(-q --quiet)'{-q,--quiet}'[Only output problems]' \
        '--skip-missing[Do not check for removed files]' \
        '--include-hidden[Include hidden files and directories]' \
        '--case-insensitive[Treat file paths as case-insensitive]' \
        '*--exclude[Exclude directories]:directory:_directories' \
        '--db[Custom database path]:file:_files' \
        '--export[Export checksums manifest]:file:_files' \
        '--json[Output results as JSON]' \
        '--budget[Time budget for full scans]:duration:(30m 1h 2h 4h 1h30m 2h30m)' \
        '--due[Re-verify files not checked within N days]:days:(7d 14d 30d 60d 90d)' \
        '--track[Install scheduled scans (launchd/systemd)]' \
        '--auto-export[Write a b2sum-compatible manifest after --check]' \
        '--run-on-battery[Windows: allow scheduled scans on battery power]' \
        '--track-setup[Interactive setup wizard for --track]' \
        '--status[Show status of all scheduled scans]' \
        '--repair[Re-point broken scheduled scans after an upgrade]' \
        '--untrack[Remove scheduled scans for a directory]' \
        '--untrack-all[Remove all scheduled scans]' \
        '--clear-logs[Clear rotbyte scheduler logs]' \
        '--docs[Show a setup guide in the terminal]:topic:(notify permissions scheduler)' \
        '--every[Quick scan frequency for --track]:interval:(30m 1h 2h 4h)' \
        '*--full-at[Daily clock times for full scans]:time:(0h 1h 2h 3h 4h 6h 12h 14h 18h 22h)' \
        '--notify[Send notification on problems]:backend:(email)' \
        '--notify-setup[Interactive notification setup]:backend:(email)' \
        '--version[Show version]' \
        '--help[Show quick-reference help]' \
        '--help-all[Show full option list]' \
        '1:directory:_directories'
}

_rotbyte "$@"
