Implement possibility to copy output of commands to paste buffers.

This commit is contained in:
Oleksandr Kozachuk
2022-12-17 14:54:16 +01:00
parent 6286ce4238
commit 9347bc3972
5 changed files with 48 additions and 5 deletions
+2
View File
@@ -16,6 +16,7 @@ peg::parser! {
/ ls_cmd()
/ mv_cmd()
/ rm_cmd()
/ pb_cmd()
/ enc_cmd()
/ pass_cmd()
/ noop_cmd()
@@ -75,6 +76,7 @@ peg::parser! {
rule noop_cmd() -> Command<'input> = (" " / "\r" / "\n" / "\t")* ("#" comment())? { Command::Noop }
rule help_cmd() -> Command<'input> = "help" { Command::Help }
rule quit_cmd() -> Command<'input> = "quit" { Command::Quit }
rule pb_cmd() -> Command<'input> = "pb" _ e:$(([' '..='~'])+) { Command::PasteBuffer(e.to_string()) }
rule ls_cmd() -> Command<'input> = "ls" f:comment()? { Command::Ls(f.unwrap_or(".".to_string())) }
rule add_cmd() -> Command<'input> = "add" _ name:name() { Command::Add(Rc::new(RefCell::new(name))) }
rule error_cmd() -> Command<'input> = "error" _ e:$(([' '..='~'])+) { Command::Error(LKErr::Error(e)) }