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