aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRuben Pollan2018-12-10 16:55:27 +0100
committerRuben Pollan2018-12-10 16:55:27 +0100
commita45cf07e92b58f29aa88413a30d921edba48872f (patch)
treee2b80f0bcfabafa98642d59c59aba2718b9b0725 /src
parentfe1fab184fac5beb1bc222ff46bcd6a32f20990d (diff)
Update readme and usage
Diffstat (limited to 'src')
-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