|
@ -31,9 +31,7 @@ fn main() -> Result<()> { |
|
|
match readline {
|
|
|
match readline {
|
|
|
Ok(line) => match interpret(line, &mut config, ctrlc_recv.clone()) {
|
|
|
Ok(line) => match interpret(line, &mut config, ctrlc_recv.clone()) {
|
|
|
Ok(_) => prompt.style = config.prompt_style.clone(),
|
|
|
Ok(_) => prompt.style = config.prompt_style.clone(),
|
|
|
Err(ShellError::EmptyLine) => {
|
|
|
|
|
|
continue;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
Err(ShellError::EmptyLine) => continue,
|
|
|
Err(ShellError::NotFound(cmd)) => {
|
|
|
Err(ShellError::NotFound(cmd)) => {
|
|
|
eprintln!("{}: command not found", cmd.get_program().to_string_lossy())
|
|
|
eprintln!("{}: command not found", cmd.get_program().to_string_lossy())
|
|
|
}
|
|
|
}
|
|
@ -43,16 +41,10 @@ fn main() -> Result<()> { |
|
|
Err(ShellError::MalformedArgs(args)) => {
|
|
|
Err(ShellError::MalformedArgs(args)) => {
|
|
|
eprintln!("Malformed arguments: {}", args)
|
|
|
eprintln!("Malformed arguments: {}", args)
|
|
|
}
|
|
|
}
|
|
|
Err(ShellError::Interrupt) => {
|
|
|
|
|
|
continue;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
Err(ShellError::Interrupt) => continue,
|
|
|
},
|
|
|
},
|
|
|
Err(ReadlineError::Interrupted) => {
|
|
|
|
|
|
continue;
|
|
|
|
|
|
}
|
|
|
|
|
|
Err(ReadlineError::Eof) => {
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
Err(ReadlineError::Interrupted) => continue,
|
|
|
|
|
|
Err(ReadlineError::Eof) => break,
|
|
|
Err(err) => {
|
|
|
Err(err) => {
|
|
|
eprintln!("Error: {:?}", err);
|
|
|
eprintln!("Error: {:?}", err);
|
|
|
break;
|
|
|
break;
|
|
|