Skip to content

Reject unknown CLI options instead of silently ignoring them #191

Description

@AetherAI3

Problem

The top-level parser uses parseArgs({ strict: false }) and discards unrecognized entries from values. A misspelled option can make a command run a different mode while reporting success. This is especially misleading for verification commands.

Reproduction (built from current main, b037891)

Run aether doctor --lve --json (typo for --live) in an empty local config directory. It exits 0 and returns "mode":"fast" with remote checks marked "not-checked". The doctor command's own unknown-argument validation never sees --lve, because main.ts stripped it first. aether --version --not-a-real-flag also exits 0.

src/commands/cli_registry.ts already documents this parser behavior for command flags: an undeclared flag “simply vanishes.” That comment explains why valid options are registered; it does not protect users from typos or stale scripts.

Expected

Reject unknown CLI options with a nonzero exit and a useful message before dispatch. Preserve intentional bare prompt/positional behavior and the -- delimiter. Cover a misspelled verification flag such as doctor --lve and a command with a value-taking flag in regression tests.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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