Skip to content

Reject unknown values passed to --debug-wave #648

Closed

Description

@LunaStev

Current evidence

DebugFlags::apply in src/flags.rs recognizes tokens, ast, ir, mc, hex, and all, but its fallback branch silently ignores every other value. src/cli.rs accepts both --debug-wave=<value> and --debug-wave <value> without checking whether every requested mode was recognized.

A typo such as --debug-wave=toknes therefore succeeds while enabling nothing, which makes the command line appear valid even though the requested diagnostic mode was not applied.

Scope

  • Reject unknown debug modes with a normal CLI usage error.
  • Preserve comma-separated valid modes and all.
  • When a list mixes valid and invalid values, report the invalid value instead of partially accepting the option silently.
  • Keep the existing debug modes and their behavior unchanged.

Completion criteria

  • CLI tests cover a valid single mode, a valid comma-separated list, an unknown mode, and a mixed valid/invalid list.
  • Both --debug-wave=value and --debug-wave value use the same validation.
  • Invalid input exits through the existing usage-error path.

Activity

  1. added
    bug
    good first issue
    on Sep 15, 2026
  2. self-assigned this
    on Sep 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

buggood first issue

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions