minigrep_pack
Small example crate and binary that demonstrate a simple line-oriented search (a micro "grep" clone).
Quick start
Build and run the binary with:
cargo run -- <query> <filename>
Example:
cargo run -- foo example.txt
Library usage
Programmatic usage:
- Call
minigrep_pack::Config::new(&args)to parse CLI-style arguments. - Call
minigrep_pack::run(config)to perform the search and print matching lines.
Testing
Run the test suite with:
cargo test
Publishing checklist
- Ensure
cargo testpasses. - Verify
Cargo.tomlcontains correct metadata (authors, description, license, repository, readme). - Update
versioninCargo.tomlfor a new release. - Run
cargo publish --dry-runto validate before publishing.
License
MIT