Skip to content

[BUG] Config Mode Parsing Doesn't Validate Against Valid Enum Values #193

@xyz080125

Description

@xyz080125

Project

vgrep

Description

In commands.rs line 1079, mode parsing uses value.parse()? which relies on the Mode enum's FromStr implementation. If invalid values are provided, the error message may be unclear.

Error Message

Debug Logs

System Information

OS: Any
Rust Version: 1.75+

Screenshots

No response

Steps to Reproduce

  1. Run vgrep config set mode invalid_value
  2. Observe error

Expected Behavior

Clear error listing valid mode options (Local, Server)

Actual Behavior

Generic parse error without listing valid options

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingvalidValid issuevgrep

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions