grrs_hj

Crates.iogrrs_hj
lib.rsgrrs_hj
version0.1.1
sourcesrc
created_at2023-01-29 22:09:39.708406
updated_at2023-01-30 14:05:35.930297
descriptionA tool to search files
homepagehttps://github.com/JuliaJHL/week2-rust-mini-proj.git
repositoryhttps://github.com/JuliaJHL/week2-rust-mini-proj.git
max_upload_size
id771249
size34,049
(JuliaJHL)

documentation

README

A command line application in Rust

  • This is a tool where we can give a string and a path, and it will print only the lines containing the given string.
  • I distributed it with cargo in this link.
  • We are able to run the tool like this:
$ cat test.txt
apple 1
bee 2
cat 3
dog 4
apple 5
$ grrs_hj apple test.txt
apple 1
apple 5

project setup

  1. Clone the repo:
git clone https://github.com/JuliaJHL/week2-rust-mini-proj.git
  1. cd into the repo:
cd week2-rust-mini-proj
  1. compile the project:
cargo build --release
  1. run the project:
cargo run -- xxx(pattern) xxx(path)

examples:

I created a test.txt with the following contents:

apple 1
bee 2
cat 3
dog 4
apple 5

When we apply cargo run -- apple test.txt, it would only return:

apple 1
apple 5

run_img

Distributing with cargo

I made package info updates in Cargo.toml and pushlished it via:

cargo login
cargo publish

Therefore, you can install grrs_hj and run it without cloning the repo by implementing the following commands directly:

cargo install grrs_hj
grrs_hj xxx(pattern) xxx(path)

Here is an example: grrs_hj

References

Commit count: 13

cargo fmt