Add possibility to add input instead of calling readline.

This commit is contained in:
Oleksandr Kozachuk
2023-01-06 17:13:42 +01:00
parent e9dba54750
commit 77f7db7dec
2 changed files with 9 additions and 7 deletions
+1 -1
View File
@@ -14,7 +14,7 @@ lazy_static! {
pub fn hel_command(cmd: String) -> String {
let editor = Editor::new();
let mut lkread = LKRead::new(editor, "> ".to_string(), STATE.clone());
lkread.cmd = cmd.to_string();
lkread.input = Some(cmd.to_string());
let lkeval = lkread.read();
let lkprint = lkeval.eval();
lkprint.out.output().join("\n")