mirror of
https://github.com/tursodatabase/limbo.git
synced 2025-08-04 18:18:03 +00:00
cleanup shell tests and cli
This commit is contained in:
parent
248a369afc
commit
5f02521d08
8 changed files with 647 additions and 586 deletions
|
@ -1,6 +1,7 @@
|
|||
#![allow(clippy::arc_with_non_send_sync)]
|
||||
mod app;
|
||||
mod import;
|
||||
mod input;
|
||||
mod opcodes_dictionary;
|
||||
|
||||
use rustyline::{error::ReadlineError, DefaultEditor};
|
||||
|
@ -8,17 +9,17 @@ use std::sync::atomic::Ordering;
|
|||
|
||||
fn main() -> anyhow::Result<()> {
|
||||
env_logger::init();
|
||||
let mut app = app::Limbo::new()?;
|
||||
let mut rl = DefaultEditor::new()?;
|
||||
let mut app = app::Limbo::new(&mut rl)?;
|
||||
let home = dirs::home_dir().expect("Could not determine home directory");
|
||||
let history_file = home.join(".limbo_history");
|
||||
if history_file.exists() {
|
||||
rl.load_history(history_file.as_path())?;
|
||||
app.rl.load_history(history_file.as_path())?;
|
||||
}
|
||||
loop {
|
||||
let readline = rl.readline(&app.prompt);
|
||||
let readline = app.rl.readline(&app.prompt);
|
||||
match readline {
|
||||
Ok(line) => match app.handle_input_line(line.trim(), &mut rl) {
|
||||
Ok(line) => match app.handle_input_line(line.trim()) {
|
||||
Ok(_) => {}
|
||||
Err(e) => {
|
||||
eprintln!("{}", e);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue