diff --git a/Cargo.toml b/Cargo.toml index 6f8c1a4..9b79977 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rgen" -version = "1.0.0" +version = "1.1.0" authors = ["Mateusz Czarnecki (DemwE)"] description = "A simple CLI tool for generating random passwords." edition = "2021" diff --git a/src/args.rs b/src/args.rs index fd5d887..68a8b75 100644 --- a/src/args.rs +++ b/src/args.rs @@ -20,4 +20,7 @@ pub struct RgenArgs { /// Use special characters #[clap(short, long)] pub special: bool, + /// Raw output + #[clap(short, long)] + pub raw: bool, } diff --git a/src/main.rs b/src/main.rs index d5348ce..1873529 100644 --- a/src/main.rs +++ b/src/main.rs @@ -25,6 +25,12 @@ fn main() { .map(|_| available_characters.chars().nth(rng.gen_range(0..available_characters.len())).unwrap()) .collect(); - println!("Generated password: {}", password); + if args.raw { + println!("{}", password); + continue; + } + else { + println!("Generated password: {}", password); + } } }