Skip to content

query exits with error on zero results #19

Description

@oritwoen

When a query finds nothing, shaha exits with a non-zero status code:

if results.is_empty() {
    bail!("No matches found");
}

This makes scripting awkward — you can't distinguish "query failed" from "query succeeded but found nothing" without parsing stderr. Standard tools like grep handle this with exit code 1 for no matches vs exit code 2 for actual errors.

For a tool that's useful in pipelines (CTF scripts, batch lookups), "no match" should be exit 0 with empty output, or a dedicated exit code separate from general errors.

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