diff options
author | Saumit Dinesan <justsaumit@protonmail.com> | 2022-06-14 18:35:00 +0530 |
---|---|---|
committer | Saumit Dinesan <justsaumit@protonmail.com> | 2022-06-14 18:35:00 +0530 |
commit | ec7274956c989b39e470c9430ec4001146adb434 (patch) | |
tree | 0ea1d87d5d840ce02b738c867dc1c13be3e66bdc /src | |
parent | 09ea40bbfbbff1d64e502886a7fa2554a5190ce6 (diff) |
Prototype1
Diffstat (limited to 'src')
-rw-r--r-- | src/main.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs index 6366b0f..0ac993e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -14,7 +14,17 @@ struct Cli { } fn main() { + let args = Cli::parse(); + let content = std::fs::read_to_string(&args.path) + .expect("could not read file"); + + for line in content.lines() { + if line.contains(&args.pattern) { + println!("{}", line); + } + } + } |