From a45cf07e92b58f29aa88413a30d921edba48872f Mon Sep 17 00:00:00 2001 From: Ruben Pollan Date: Mon, 10 Dec 2018 16:55:27 +0100 Subject: Update readme and usage --- src/main.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/main.rs b/src/main.rs index 03eab2e..beca8d9 100644 --- a/src/main.rs +++ b/src/main.rs @@ -15,7 +15,14 @@ use almanac::Event; fn main() { let mut args = env::args().skip(1); - let (first, last) = period(&args.next().unwrap()); + let period_arg = match args.next() { + Some(arg) => arg, + None => { + println!("Usage: almanac [day|week|month] ics [ics ...]"); + return; + } + }; + let (first, last) = period(&period_arg); let calendars: Vec<_> = args.map(|arg| ics_calendar(&arg)).collect(); let events = calendars -- cgit v1.2.3