aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/main.rs9
1 files changed, 8 insertions, 1 deletions
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