use clap::{Command, Arg};
mod lib;
fn main() {
let cli = Command::new("cli")
.about("A small crate to convert different amounts of different currencies!
This is crate sensitive!\n
This crate might contain bugs!
This is a small project i did so it isn't perfect, but i will try to maintain it as much as i can.")
.arg(Arg::new("amount")
.takes_value(true)
.required(true)
.help("The amount of money you want to convert hint: xchange-rs <amount> <from> <to>"))
.arg(Arg::new("from")
.takes_value(true)
.required(true)
.help("The currency you wnat to convert from! e.g.: USD"))
.arg(Arg::new("to")
.takes_value(true)
.required(true)
.help("The currency you wnat to convert to! e.g.: EUR"))
.get_matches();
let f = lib::xchangeit(cli.value_of("amount"), cli.value_of("from"), cli.value_of("to"));
match f {
Ok(o) => Ok(o),
Err(e) => Err(e),
};
}