Reject unknown values passed to --debug-wave

Open Beginner friendly
#648 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
86/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
rust
Domain
cli

Research direction

Start in src/flags.rs at DebugFlags::apply and compare its recognized modes with argument handling in src/cli.rs. Run or extend the CLI tests for valid single and comma-separated modes, unknown and mixed values, and both option forms; done means invalid input follows the existing usage-error path while valid modes and all retain their behavior.

Written by the indexing model from the issue text.

Description

bug good first issue

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.
Dominant language
Rust
Stars
53
Forks
16
Avg merge
4h 6m
Merged PRs (30d)
44

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from wavefnd/Wave

All issues in wavefnd/Wave

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.