1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
use luz::dump_luz;
use lvl::{dump_lvl, rebuild_lvl};

mod luz;
mod lvl;

fn main() {
    let mut args = std::env::args();
    let usage = "USAGE: lump [decode|encode] [luz|lvl] FILE";
    let cmd = args.nth(1).expect(usage);
    let format = args.next().expect(usage);
    let path = args.next().expect(usage);
    match (cmd.as_str(), format.as_str()) {
        ("decode", "lvl") => dump_lvl(&path),
        ("encode", "lvl") => rebuild_lvl(&path),
        ("decode", "luz") => dump_luz(&path),
        ("encode", "luz") => todo!(),
        _ => todo!("{}", usage),
    }
}