|
@ -1,11 +1,17 @@ |
|
|
|
|
|
mod prompt;
|
|
|
|
|
|
|
|
|
use rustyline::error::ReadlineError;
|
|
|
use rustyline::error::ReadlineError;
|
|
|
use rustyline::{Editor, Result};
|
|
|
use rustyline::{Editor, Result};
|
|
|
|
|
|
|
|
|
|
|
|
use crate::prompt::Prompt;
|
|
|
|
|
|
|
|
|
fn main() -> Result<()> {
|
|
|
fn main() -> Result<()> {
|
|
|
let mut rl = Editor::<()>::new()?;
|
|
|
let mut rl = Editor::<()>::new()?;
|
|
|
|
|
|
|
|
|
|
|
|
let mut prompt = Prompt::new();
|
|
|
|
|
|
|
|
|
loop {
|
|
|
loop {
|
|
|
let readline = rl.readline("» ");
|
|
|
|
|
|
|
|
|
let readline = rl.readline(&prompt.get_prompt());
|
|
|
|
|
|
|
|
|
match readline {
|
|
|
match readline {
|
|
|
Ok(line) => {
|
|
|
Ok(line) => {
|
|
|