|
|
@ -60,6 +60,9 @@ fn main() -> Result<()> {
|
|
|
|
if event.code == key::ENTER {
|
|
|
|
if event.code == key::ENTER {
|
|
|
|
shell.output.newline()?;
|
|
|
|
shell.output.newline()?;
|
|
|
|
let s = shell.line.pop();
|
|
|
|
let s = shell.line.pop();
|
|
|
|
|
|
|
|
info!("◇ {}", s);
|
|
|
|
|
|
|
|
let tree = parse::parse(&s)?;
|
|
|
|
|
|
|
|
debug!(" {:?}", tree);
|
|
|
|
let parts: Vec<&str> = s.split_whitespace().collect();
|
|
|
|
let parts: Vec<&str> = s.split_whitespace().collect();
|
|
|
|
|
|
|
|
|
|
|
|
if parts.len() > 0 {
|
|
|
|
if parts.len() > 0 {
|
|
|
@ -69,10 +72,9 @@ fn main() -> Result<()> {
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
vec![]
|
|
|
|
vec![]
|
|
|
|
};
|
|
|
|
};
|
|
|
|
debug!("◇ {} {}", cmd.clone(), args.join(" "));
|
|
|
|
|
|
|
|
match shell.eval(cmd.clone(), args.clone()) {
|
|
|
|
match shell.eval(cmd.clone(), args.clone()) {
|
|
|
|
Ok(true) => info!("▷ {} {}", cmd, args.join(" ")),
|
|
|
|
Ok(true) => debug!(" ok"),
|
|
|
|
Ok(false) => warn!("▷ {} {}", cmd, args.join(" ")),
|
|
|
|
Ok(false) => warn!(" fail"),
|
|
|
|
Err(e) => {
|
|
|
|
Err(e) => {
|
|
|
|
error!("▷ {} {} ● {}", cmd, args.join(" "), e);
|
|
|
|
error!("▷ {} {} ● {}", cmd, args.join(" "), e);
|
|
|
|
println!("error: {}", e);
|
|
|
|
println!("error: {}", e);
|
|
|
|