aboutsummaryrefslogtreecommitdiffstats
path: root/src/bin/rbw/commands.rs
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2024-04-20 14:58:42 -0400
committerJesse Luehrs <doy@tozt.net>2024-04-20 14:58:42 -0400
commit52cd14086afbfae2a0ad26254c69508badbfbd67 (patch)
tree8d0dcaae66be658a55cbd8b062ca4b080e546b06 /src/bin/rbw/commands.rs
parente9c45e642bad7b56b2f95d0441ddce913455f204 (diff)
downloadrbw-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.rs3
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"