From 7786a012b11ac839e98d2ddf1f3e3768c48d0cc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Mon, 18 Feb 2019 17:13:13 +0100 Subject: Slightly improve main default output. --- main.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/main.c b/main.c index e06d7d4f..ec8041a5 100644 --- a/main.c +++ b/main.c @@ -39,18 +39,24 @@ int main (int argc, char* argv[argc]) { if (args.argc == 0 || strcmp(args.argv[0], "-p") == 0) { INFO_F("Parsed calendar file containing [%u] events", root.components.length); + + puts("CAL : OBJ | Filename | Description"); + puts("----------+----------+------------"); + + /* This loops over all VCALENDAR's in root */ for (size_t i = 0; i < root.components.length; i++) { vcomponent* cal = GET(VECT(vcomponent))(&root.components, i); assert(strcmp(cal->type, "VCALENDAR") == 0); char* filename = cal->filename; + /* This loop over all VEVENT's in the current VCALENDAR */ for (size_t j = 0; j < cal->components.length; j++) { vcomponent* ev = GET(VECT(vcomponent))(&cal->components, j); if (strcmp(ev->type, "VEVENT") != 0) continue; - printf("%3lu | %s | %s\n", - i + 1, + printf("%3lu : %3lu | %s | %s\n", + i + 1, j + 1, filename, get_property(ev, "SUMMARY")->val.cur->value->key.mem); } -- cgit v1.2.3