-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e65ae44
commit b2c3172
Showing
6 changed files
with
27 additions
and
4 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,4 @@ version = "0.1.0" | |
edition = "2021" | ||
|
||
[dependencies] | ||
log = "0.4.22" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,10 @@ | ||
pub fn execute(_file_name: String, _text: String) {} | ||
use std::fs::read_to_string; | ||
|
||
pub fn execute(file_name: String, text: String) { | ||
for line in read_to_string(file_name).unwrap().lines() { | ||
let cur_line = line.to_string(); | ||
if cur_line.contains(text.as_str()) { | ||
println!("{}", cur_line) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
pub fn execute(_dirs: &[String]) {} | ||
pub fn execute(dirs: &[String]) { | ||
for dir in dirs { | ||
println!("{} contains following files:", dir); | ||
list_dir(dir); | ||
} | ||
} | ||
|
||
fn list_dir(_dir: &String) {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
mod commands; | ||
|
||
use std::env; | ||
use std::io::prelude::*; | ||
|
||
fn main() { | ||
let args: Vec<String> = env::args().collect(); | ||
|