diff --git a/hel/src/commands.rs b/hel/src/commands.rs index 29f3421..240a135 100644 --- a/hel/src/commands.rs +++ b/hel/src/commands.rs @@ -104,7 +104,7 @@ impl<'a> LKEval<'a> { } } - pub fn cmd_leave(&self, out: &LKOut, name: &Name) { + pub fn cmd_keep(&self, out: &LKOut, name: &Name) { let pwd = match self.state.lock().borrow().ls.get(name) { Some(pwd) => pwd.clone(), None => { diff --git a/hel/src/parser.rs b/hel/src/parser.rs index a891fda..5838940 100644 --- a/hel/src/parser.rs +++ b/hel/src/parser.rs @@ -8,7 +8,7 @@ peg::parser! { pub grammar command_parser() for str { pub rule cmd() -> Command<'input> = c:(info_cmd_list() / mod_cmd_list() / enc_cmd_list() / asides_cmd_list()) { c } pub rule info_cmd_list() -> Command<'input> = space()* c:(ls_cmd() / ld_cmd() / pb_cmd() / save_cmd() / save_def_cmd() / dump_cmd()) { c } - pub rule mod_cmd_list() -> Command<'input> = space()* c:(add_cmd() / leave_cmd() / mv_cmd() / rm_cmd() / comment_cmd ()) { c } + pub rule mod_cmd_list() -> Command<'input> = space()* c:(add_cmd() / keep_cmd() / mv_cmd() / rm_cmd() / comment_cmd ()) { c } pub rule asides_cmd_list() -> Command<'input> = space()* c:(help_cmd() / source_cmd() / quit_cmd() / noop_cmd() / error_cmd()) { c } pub rule enc_cmd_list() -> Command<'input> = space()* c:(enc_cmd() / gen_cmd() / pass_cmd() / unpass_cmd() / correct_cmd() / uncorrect_cmd()) { c } pub rule script() -> Vec> = c:(info_cmd_list() / mod_cmd_list() / enc_cmd_list() / asides_cmd_list()) ++ "\n" { c } @@ -89,7 +89,7 @@ peg::parser! { rule ls_cmd() -> Command<'input> = "ls" f:comment()? { Command::Ls(f.unwrap_or(".".to_string())) } rule ld_cmd() -> Command<'input> = "ld" f:comment()? { Command::Ld(f.unwrap_or(".".to_string())) } rule add_cmd() -> Command<'input> = "add" _ name:name() { Command::Add(Password::from_password(name)) } - rule leave_cmd() -> Command<'input> = "leave" _ name:word() { Command::Leave(name.to_string()) } + rule keep_cmd() -> Command<'input> = "keep" _ name:word() { Command::Keep(name.to_string()) } rule gen_cmd() -> Command<'input> = "gen" n:num()? _ name:name() { Command::Gen(match n { Some(n) => n, None => 10_u32 }, Password::from_password(name)) } diff --git a/hel/src/repl.rs b/hel/src/repl.rs index 399a872..90b65a2 100644 --- a/hel/src/repl.rs +++ b/hel/src/repl.rs @@ -99,7 +99,7 @@ impl<'a> LKEval<'a> { self.cmd_ls(&out, filter.to_string(), |a, b| a.lock().borrow().date.cmp(&b.lock().borrow().date)) } Command::Add(name) => self.cmd_add(&out, &name), - Command::Leave(name) => self.cmd_leave(&out, &name), + Command::Keep(name) => self.cmd_keep(&out, &name), Command::Comment(name, comment) => self.cmd_comment(&out, &name, &comment), Command::Rm(name) => match self.get_password(name) { Some(pwd) => { diff --git a/hel/src/structs.rs b/hel/src/structs.rs index 1ea56d7..cbc31cf 100644 --- a/hel/src/structs.rs +++ b/hel/src/structs.rs @@ -60,7 +60,7 @@ pub enum LKErr<'a> { #[derive(Debug)] pub enum Command<'a> { Add(PasswordRef), - Leave(Name), + Keep(Name), Ls(String), Ld(String), Mv(Name, Name),