aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuben Pollan2018-12-10 16:55:27 +0100
committerRuben Pollan2018-12-10 16:55:27 +0100
commita45cf07e92b58f29aa88413a30d921edba48872f (patch)
treee2b80f0bcfabafa98642d59c59aba2718b9b0725
parentfe1fab184fac5beb1bc222ff46bcd6a32f20990d (diff)
Update readme and usage
-rw-r--r--Cargo.toml5
-rw-r--r--README.md16
-rw-r--r--src/main.rs9
3 files changed, 28 insertions, 2 deletions
diff --git a/Cargo.toml b/Cargo.toml
index 551bb3e..565faa0 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -4,6 +4,11 @@ version = "0.1.0"
authors = ["meskio <meskio@sindominio.net>"]
license = "GPL-3.0-or-later"
description = "Display calendar .ics in command line"
+readme = "README.md"
+homepage = "https://gitlab.com/meskio/almanac"
+repository = "https://gitlab.com/meskio/almanac"
+documentation = "https://docs.rs/almanac/"
+keywords = ["calendar", "ics", "ical", "terminal", "console"]
[dependencies]
chrono = "0.4"
diff --git a/README.md b/README.md
index 45ed09e..c8ee994 100644
--- a/README.md
+++ b/README.md
@@ -1,3 +1,17 @@
# Almanac
-Simple .ics parser to print the following events on the command line.
+Simple .ics parser to pretty print the events on the terminal.
+
+## Usage
+
+```
+$ almanac week personal.ics other.ics
+
+Mon Dec 10 2018
+ 17:00-18:00 event 1
+
+Wed Dec 12 2018
+ ----------- all day event
+ description
+ 19:00-20:00 nother event
+```
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