Simplify the parser and define password types explicitly.

This commit is contained in:
Kiyomichi Kosaka
2022-12-03 22:57:28 +00:00
parent 47243330a9
commit 66acff9884
5 changed files with 76 additions and 35 deletions
+9
View File
@@ -105,6 +105,15 @@ impl<'a> LKEval<'a> {
self.state.borrow().fix_hierarchy();
}
}
Command::Comment(name, comment) => match self.state.borrow().db.get(name) {
Some(pwd) => {
pwd.borrow_mut().comment = match comment {
Some(c) => Some(c.to_string()),
None => None,
}
}
None => out.push("error: password not found".to_string()),
},
Command::Help => {
out.push("HELP".to_string());
}