diff options
author | Jesse Luehrs <doy@tozt.net> | 2020-07-25 03:53:02 -0400 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2020-07-25 04:10:20 -0400 |
commit | 56e9b720bade5dcdc6505952c1bf81bdeca26bcd (patch) | |
tree | e85f8e09e258a1a86b6c905c6c8772d9c27fef24 /src/bin/rbw/main.rs | |
parent | c5d01a97ae4fda0871c8fd49777be325376ba5df (diff) | |
download | rbw-56e9b720bade5dcdc6505952c1bf81bdeca26bcd.tar.gz rbw-56e9b720bade5dcdc6505952c1bf81bdeca26bcd.zip |
also display the totp code
Diffstat (limited to 'src/bin/rbw/main.rs')
-rw-r--r-- | src/bin/rbw/main.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/bin/rbw/main.rs b/src/bin/rbw/main.rs index 258fd04..f1903e7 100644 --- a/src/bin/rbw/main.rs +++ b/src/bin/rbw/main.rs @@ -56,6 +56,16 @@ enum Opt { full: bool, }, + #[structopt(about = "Display the authenticator code for a given entry")] + Code { + #[structopt(help = "Name or UUID of the entry to display")] + name: String, + #[structopt(help = "Username of the entry to display")] + user: Option<String>, + #[structopt(long, help = "Folder name to search in")] + folder: Option<String>, + }, + #[structopt( about = "Add a new password to the database", long_about = "Add a new password to the database\n\n\ @@ -200,6 +210,7 @@ impl Opt { Self::Sync => "sync".to_string(), Self::List { .. } => "list".to_string(), Self::Get { .. } => "get".to_string(), + Self::Code { .. } => "code".to_string(), Self::Add { .. } => "add".to_string(), Self::Generate { .. } => "generate".to_string(), Self::Edit { .. } => "edit".to_string(), @@ -272,6 +283,9 @@ fn main(opt: Opt) { folder, full, } => commands::get(&name, user.as_deref(), folder.as_deref(), *full), + Opt::Code { name, user, folder } => { + commands::code(&name, user.as_deref(), folder.as_deref()) + } Opt::Add { name, user, |