Pattern Quest is a simple Rust-based grep clone that allows you to search for patterns in text files with additional features like case-insensitive searching and line number display.
Pattern Quest is a lightweight command-line utility inspired by grep, designed to search for patterns in text files. It provides additional features like case-insensitive searching and the ability to display line numbers.
-
Case-Insensitive Searching:
- Enable case-insensitive searching by setting the
IGNORE_CASE
environment variable.
- Enable case-insensitive searching by setting the
-
Show Line Numbers:
- Display line numbers alongside search results.
-
Invert Search Results:
- Invert the search results by setting the
INVERT_SEARCH
environment variable.
- Invert the search results by setting the
To use Pattern Quest, follow these installation steps:
# Clone the repository
git clone https://github.com/yourusername/pattern-quest.git
# Navigate to the project directory
cd pattern-quest
# Build the project
cargo build
# Run the executable
cargo run -- --query "example" --file "path/to/example.txt"
Pattern Quest supports the following command-line options:
# Example usage with case-insensitive searching and inverted searching
IGNORE_CASE=1 INVERT_SEARCH=1 cargo run -- --query "example" --file "path/to/example.txt"
Pattern Quest can be configured using environment variables. Set these variables based on your preferences:
-
INVERT_SEARCH
- Set this environment variable to enable inverted searching.
export INVERT_SEARCH=true
-
IGNORE_CASE:
- Set this environment variable to enable case-insensitive searching.
export IGNORE_CASE=true
The following features are planned to be added in future releases:
Allow users to redirect search results to a specified file.
Provide help and usage information using the --help option.
Stay tuned for updates as we work on enhancing Pattern Quest!
Contributions to Pattern Quest are highly encouraged and appreciated. Here's how you can contribute:
Submit issues for bugs, feature requests, or enhancements on the Issue Tracker.
Contribute directly by opening pull requests. Ensure your changes align with the CONTRIBUTING.md guidelines. Guidelines:
Follow the guidelines outlined in the CONTRIBUTING.md file for coding standards, testing, and documentation. By contributing, you play a vital role in improving Pattern Quest for the entire community!
Pattern Quest is licensed under the MIT License. See the LICENSE file for details.