aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
blob: 62da4a5f80e54f23933a0d8144c7197c907a6a67 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
use std::env;
use dictionarium;

fn main() {
    let args: Vec<String> = env::args().skip(1).collect();

    if args.len() == 0 {
        dictionarium::param(String::from("--help"));
    } else {
        let mut words = Vec::<String>::new();
        for word in args {
            if word.len() > 2 && word.get(0..2).unwrap_or_default() == "--" {
                dictionarium::param(word);
            } else {
                words.push(word);
            }
        }

        // we accept multiple words gladly
        for word in words {
            dictionarium::handle(word);
        }
    }
}