mod cli;
mod clipboard;
mod commands;
mod output;
mod qr;
mod secret;
use anyhow::Result;
use clap::Parser;
use cli::{Cli, Command};
fn main() -> Result<()> {
let cli = Cli::parse();
match cli.command {
Command::Add {
description,
length,
secret,
secret_stdin,
} => commands::add::run(description, length, secret, secret_stdin),
Command::Get {
key,
description,
secret,
secret_stdin,
copy,
qr,
json,
} => commands::get::run(key, description, secret, secret_stdin, copy, qr, json),
Command::List { json } => commands::list::run(json),
Command::Delete {
key,
description,
yes,
} => commands::delete::run(key, description, yes),
Command::Edit {
key,
description,
new_description,
new_length,
} => commands::edit::run(key, description, new_description, new_length),
Command::Verify {
key,
description,
secret,
secret_stdin,
} => commands::verify::run(key, description, secret, secret_stdin),
}
}