From ec7274956c989b39e470c9430ec4001146adb434 Mon Sep 17 00:00:00 2001 From: Saumit Dinesan Date: Tue, 14 Jun 2022 18:35:00 +0530 Subject: Prototype1 --- src/main.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/main.rs') 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); + } + } + } -- cgit v1.2.3