Skip to content

Commit

Permalink
Merge pull request #1 from DemwE/development
Browse files Browse the repository at this point in the history
Added raw output
  • Loading branch information
DemwE committed Aug 9, 2023
2 parents c008e9e + 4fb7727 commit c1ba39f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
3 changes: 3 additions & 0 deletions src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,7 @@ pub struct RgenArgs {
/// Use special characters
#[clap(short, long)]
pub special: bool,
/// Raw output
#[clap(short, long)]
pub raw: bool,
}
8 changes: 7 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}

0 comments on commit c1ba39f

Please sign in to comment.