summaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
authorSaumit Dinesan <justsaumit@protonmail.com>2022-06-14 18:35:00 +0530
committerSaumit Dinesan <justsaumit@protonmail.com>2022-06-14 18:35:00 +0530
commitec7274956c989b39e470c9430ec4001146adb434 (patch)
tree0ea1d87d5d840ce02b738c867dc1c13be3e66bdc /src/main.rs
parent09ea40bbfbbff1d64e502886a7fa2554a5190ce6 (diff)
Prototype1
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs10
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);
+ }
+ }
+
}