|
@ -1,5 +1,7 @@ |
|
|
|
|
|
mod parse;
|
|
|
mod prompt;
|
|
|
mod prompt;
|
|
|
|
|
|
|
|
|
|
|
|
use parse::parse_line;
|
|
|
use rustyline::error::ReadlineError;
|
|
|
use rustyline::error::ReadlineError;
|
|
|
use rustyline::{Editor, Result};
|
|
|
use rustyline::{Editor, Result};
|
|
|
|
|
|
|
|
@ -15,7 +17,9 @@ fn main() -> Result<()> { |
|
|
|
|
|
|
|
|
match readline {
|
|
|
match readline {
|
|
|
Ok(line) => {
|
|
|
Ok(line) => {
|
|
|
println!("Line: {}", line);
|
|
|
|
|
|
|
|
|
if let Err(e) = parse_line(&line) {
|
|
|
|
|
|
println!("{}", e)
|
|
|
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
Err(ReadlineError::Interrupted) => {
|
|
|
Err(ReadlineError::Interrupted) => {
|
|
|
println!("CTRL-C");
|
|
|
println!("CTRL-C");
|
|
|