use std::{ io::{BufRead, BufReader, Read, Seek, SeekFrom}, path::{Path, PathBuf}, }; use eyre::Result; use crate::history::History; pub mod bash; pub mod fish; pub mod resh; pub mod zsh; // this could probably be sped up fn count_lines(buf: &mut BufReader) -> Result { let lines = buf.lines().count(); buf.seek(SeekFrom::Start(0))?; Ok(lines) } pub trait Importer: IntoIterator> + Sized { const NAME: &'static str; fn histpath() -> Result; fn parse(path: impl AsRef) -> Result; }