use structopt::StructOpt; use chrono::prelude::*; #[derive(StructOpt, Debug)] #[structopt(author = env!("CARGO_PKG_AUTHORS"))] struct Opt { /// time to convert #[structopt(value_name = "TIME")] time: String, /// specify the date on which the time lies. defaults to today. #[structopt(long, short)] date: Option, } fn main() { let Opt { time, date } = Opt::from_args(); tzconvert::convert("Europe/Brussels", "EST", &time, date); }