You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
485 B
30 lines
485 B
#![feature(associated_type_defaults)]
|
|
|
|
#[macro_use] extern crate lazy_static;
|
|
|
|
#[macro_export] macro_rules! unwrap {
|
|
($err:expr) => {
|
|
match $err {
|
|
Ok(v) => v,
|
|
Err(e) => {
|
|
eprintln!("Error: {}", e);
|
|
std::process::exit(1);
|
|
}
|
|
}
|
|
};
|
|
}
|
|
|
|
mod arg;
|
|
|
|
mod conv;
|
|
|
|
fn main() {
|
|
use arg::Operation;
|
|
match unwrap!(arg::parse_args()) {
|
|
Operation::Help => arg::usage(),
|
|
Operation::Convert(unit, from) => {
|
|
unwrap!(conv::dispatch_out(unit, from));
|
|
},
|
|
}
|
|
}
|