open with path

This commit is contained in:
thatscringebro
2026-03-12 09:41:23 -04:00
parent 30880ed104
commit bf1de016cd
2 changed files with 14 additions and 4 deletions

View File

@@ -15,15 +15,25 @@ use ratatui::{
},
prelude::Backend,
};
use std::{error::Error, io};
use std::{
env::{self},
error::Error,
io,
};
fn main() -> Result<(), Box<dyn Error>> {
enable_raw_mode()?;
let mut stderr = io::stderr();
execute!(stderr, EnterAlternateScreen, EnableMouseCapture)?;
let mut path: &str = "ft_rs.db";
let args: Vec<String> = env::args().collect();
if args.len() > 1 {
path = &args[1];
}
let mut terminal = ratatui::init();
let mut app = App::new();
let mut app = App::new(path);
let res = run_app(&mut terminal, &mut app);
disable_raw_mode()?;