aboutsummaryrefslogtreecommitdiffstats
path: root/src/bin/rbw/commands.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/rbw/commands.rs')
-rw-r--r--src/bin/rbw/commands.rs12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/bin/rbw/commands.rs b/src/bin/rbw/commands.rs
index a42e796..3e2f241 100644
--- a/src/bin/rbw/commands.rs
+++ b/src/bin/rbw/commands.rs
@@ -148,18 +148,18 @@ pub fn add(name: &str, username: Option<&str>) -> anyhow::Result<()> {
let password = lines.next().unwrap();
let password = crate::actions::encrypt(password)?;
- let mut note: String = lines
+ let mut notes: String = lines
.skip_while(|line| *line == "")
.filter(|line| !line.starts_with('#'))
.map(|line| format!("{}\n", line))
.collect();
- while note.ends_with('\n') {
- note.pop();
+ while notes.ends_with('\n') {
+ notes.pop();
}
- let note = if note == "" {
+ let notes = if notes == "" {
None
} else {
- Some(crate::actions::encrypt(&note)?)
+ Some(crate::actions::encrypt(&notes)?)
};
let cipher = rbw::api::Cipher {
@@ -168,6 +168,7 @@ pub fn add(name: &str, username: Option<&str>) -> anyhow::Result<()> {
username,
password: Some(password),
},
+ notes,
};
let res = rbw::actions::add(&access_token, &cipher);
@@ -222,6 +223,7 @@ pub fn generate(
username,
password: Some(password),
},
+ notes: None,
};
let res = rbw::actions::add(&access_token, &cipher);