]> Pileus Git - lackey/commitdiff
Add calendar command line flags
authorAndy Spencer <andy753421@gmail.com>
Sun, 27 Nov 2016 04:49:33 +0000 (04:49 +0000)
committerAndy Spencer <andy753421@gmail.com>
Mon, 28 Nov 2016 09:54:02 +0000 (09:54 +0000)
cals/ical.c
src/args.c

index 8e51a8640802e813eabd6103972dbe9699f58022..b21cad0efb4f78852d41ccc9466810797be7d104 100644 (file)
@@ -288,7 +288,6 @@ void ical_config(const char *group, const char *name, const char *key, const cha
                        last->next = cal;
                else
                        calendars = cal;
-               return;
        }
 
        /* Set calendar values */
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");