Skip to content

[BUG] CLI commands.rs max_results Can Be Zero Leading to Empty Results #188

@xyz080125

Description

@xyz080125

Project

vgrep

Description

The CLI in commands.rs accepts max_results as a user-configurable option without validating that it's greater than zero. Setting max_results=0 leads to always-empty results with no warning.

Error Message

Debug Logs

System Information

OS: Any
Rust Version: 1.75+

Screenshots

No response

Steps to Reproduce

  1. Run vgrep search 'query' --max-results 0
  2. Observe output

Expected Behavior

Either reject max_results=0 with an error, or warn the user that they've requested zero results

Actual Behavior

Silently returns empty results

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