mirror of
https://github.com/nushell/nushell.git
synced 2024-12-23 15:39:06 +01:00
Merge branch 'main' of github.com:jonathandturner/engine-q
This commit is contained in:
commit
40004e64a6
@ -6,7 +6,7 @@ edition = "2018"
|
|||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
reedline = {git = "https://github.com/jntrnr/reedline"}
|
reedline = { git = "https://github.com/jntrnr/reedline", branch = "main" }
|
||||||
nu-ansi-term = "0.32.0"
|
nu-ansi-term = "0.32.0"
|
||||||
# mimalloc = { version = "*", default-features = false }
|
# mimalloc = { version = "*", default-features = false }
|
||||||
|
|
||||||
|
13
src/main.rs
13
src/main.rs
@ -172,9 +172,9 @@ fn main() -> std::io::Result<()> {
|
|||||||
let stack = Stack::new();
|
let stack = Stack::new();
|
||||||
|
|
||||||
loop {
|
loop {
|
||||||
let input = line_editor.read_line(&prompt)?;
|
let input = line_editor.read_line(&prompt);
|
||||||
match input {
|
match input {
|
||||||
Signal::Success(s) => {
|
Ok(Signal::Success(s)) => {
|
||||||
if s.trim() == "exit" {
|
if s.trim() == "exit" {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -210,15 +210,18 @@ fn main() -> std::io::Result<()> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Signal::CtrlC => {
|
Ok(Signal::CtrlC) => {
|
||||||
println!("Ctrl-c");
|
println!("Ctrl-c");
|
||||||
}
|
}
|
||||||
Signal::CtrlD => {
|
Ok(Signal::CtrlD) => {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
Signal::CtrlL => {
|
Ok(Signal::CtrlL) => {
|
||||||
line_editor.clear_screen()?;
|
line_editor.clear_screen()?;
|
||||||
}
|
}
|
||||||
|
Err(err) => {
|
||||||
|
println!("Error: {:?}", err);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
current_line += 1;
|
current_line += 1;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user