use ansi_term::Color::Blue;
use clap::Parser;
use clipboard::ClipboardContext;
use clipboard::ClipboardProvider;
use colored::Colorize;
use DigitShield::*;
#[derive(Debug, Parser)]
#[command(version="1.0.0", author="Code0408", long_about = None)] struct Args {
#[arg(short = 'l', long = "len")]
len: usize,
#[arg(short = 'c', long = "complex")]
complex: String,
}
fn print_infos() {
println!(
"{}",
Blue.paint(
r#"
___ _ _ _ ___ _ _ _ _
| . \<_> ___ <_> _| |_ / __>| |_ <_> ___ | | _| |
| | || |/ . || | | | \__ \| . || |/ ._>| |/ . |
|___/|_|\_. ||_| |_| <___/|_|_||_|\___.|_|\___|
<___'
"#
)
);
}
fn main() {
print_infos();
let args = Args::parse();
let pwd = gen_password(args.len, args.complex.as_str());
println!(
"\n{}",
"Below is the password you generated, which has been copied to the clipboard by default:\n"
.underline()
);
println!("Your Password:\t{}", pwd.magenta());
println!("\n\n");
let mut ctx: ClipboardContext = ClipboardProvider::new().unwrap();
ctx.set_contents(pwd.to_owned()).unwrap();
}