aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
blob: ffa77576971ca8d11a8bb111f22adda9df01eb48 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use dict::{consts::SRC, lex, parse::ParseState};

fn main() {
    let Some(search_term) = std::env::args().skip(1).next() else {
        eprintln!("usage: dict <search-term>");
        return;
    };
    lex::lex(SRC)
        .filter_map(Result::ok)
        .fold(ParseState::new(), ParseState::advance)
        .finish()
        //.children();
        .search(search_term.to_ascii_uppercase().as_str())
        .print()
}