diff options
author | Jesse Luehrs <doy@tozt.net> | 2024-04-20 14:58:42 -0400 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2024-04-20 14:58:42 -0400 |
commit | 52cd14086afbfae2a0ad26254c69508badbfbd67 (patch) | |
tree | 8d0dcaae66be658a55cbd8b062ca4b080e546b06 /src/bin/rbw/commands.rs | |
parent | e9c45e642bad7b56b2f95d0441ddce913455f204 (diff) | |
download | rbw-52cd14086afbfae2a0ad26254c69508badbfbd67.tar.gz rbw-52cd14086afbfae2a0ad26254c69508badbfbd67.zip |
add --clipboard to rbw code
Diffstat (limited to 'src/bin/rbw/commands.rs')
-rw-r--r-- | src/bin/rbw/commands.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/bin/rbw/commands.rs b/src/bin/rbw/commands.rs index 02ab63c..703a351 100644 --- a/src/bin/rbw/commands.rs +++ b/src/bin/rbw/commands.rs @@ -1025,6 +1025,7 @@ pub fn code( name: &str, user: Option<&str>, folder: Option<&str>, + clipboard: bool, ) -> anyhow::Result<()> { unlock()?; @@ -1042,7 +1043,7 @@ pub fn code( if let DecryptedData::Login { totp, .. } = decrypted.data { if let Some(totp) = totp { - println!("{}", generate_totp(&totp)?); + val_display_or_store(clipboard, &generate_totp(&totp)?); } else { return Err(anyhow::anyhow!( "entry does not contain a totp secret" |