Skip to content

No verb rejects unknown flags: nine more CLI surfaces still answer a typo with the default #70

Description

@Railly

#67 fixed silences, where the bug was measured. The exposure is CLI-wide: no verb checked whether a flag it was handed was one it reads.

Surveyed by counting documented flags per verb:

verb own flags
say 12
detect 11
cut 11
locate 9
compare 8
silences 7 (fixed)
verify 7
joins 7
peek 6
nonspeech 4

Every parser reads the flags it knows by name and never asks what else arrived. A typo, a renamed flag, or a flag borrowed from a sibling verb produces a confident wrong answer at exit 0.

The cost is highest where a flag names a measurement parameter, because the default comes back formatted identically to a real reading. --noise on detect, --window/--stride on verify, and --lang anywhere are the ones that would corrupt numbers rather than merely surprise a human.

rejectUnknownFlags(args, known, label) in output.ts already exists and is wired into silences. Extending it is one call per verb plus its list of declared flags. Worth doing in one pass so no verb keeps the old behaviour as a surprise, and worth checking each verb's real invocations first: a caller passing a flag the verb never read still works today, and would start failing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions