crunk
1 year ago
2 changed files with 18 additions and 1 deletions
@ -1,3 +1,19 @@ |
|||||
|
#![allow(unused)] |
||||
|
use clap::Parser; |
||||
|
|
||||
|
/// Search for a pattern in a file and display the lines that contain it.
|
||||
|
#[derive(Parser)] |
||||
|
|
||||
|
struct Cli { |
||||
|
pattern: String, |
||||
|
path: std::path::PathBuf, |
||||
|
} |
||||
|
|
||||
fn main() { |
fn main() { |
||||
println!("Hello, world!"); |
let args = Cli::parse(); |
||||
|
println!("pattern: {}", args.pattern); |
||||
|
println!( |
||||
|
"path: {}", |
||||
|
args.path.into_os_string().into_string().unwrap() |
||||
|
); |
||||
} |
} |
||||
|
Loading…
Reference in new issue