]> Pileus Git - lackey/blobdiff - src/args.c
Add calendar command line flags
[lackey] / src / args.c
index 1fceff6b85ab3e16f47c8e07592e4571438cc82b..d7a6c685ec6d29dc49c3c4b5cacba787b2135a7b 100644 (file)
@@ -45,7 +45,7 @@ static int print_week = 0;
 static void usage(char *name)
 {
        printf("Usage:\n");
-       printf("  %s [OPTION...]\n", name);
+       printf("  %s [OPTION...] [CALENDAR]\n", name);
        printf("\n");
        printf("Options:\n");
        printf("  -h, --help  Print usage information\n");
@@ -83,6 +83,10 @@ void args_init(void)
                }
        }
 
+       /* Load calendars */
+       for (int i = optind; i < argc; i++)
+               cal_config("ical", argv[i], "location", argv[i]);
+
        /* Validate arguments */
        if (print_day && print_week)
                error("Cannot print both day and week");