Add -l/--limit option
Adds the -l/--limit command line option. Limits the number of appointments and/or ToDo items displayed. Signed-off-by: William Pettersson <william.pettersson@gmail.com> Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
This commit is contained in:
committed by
Lukas Fleischer
parent
906c2fa027
commit
fb61744f33
@@ -507,11 +507,13 @@ void day_write_pad(long date, int width, int length, int incolor)
|
||||
|
||||
/* Write the appointments and events for the selected day to stdout. */
|
||||
void day_write_stdout(long date, const char *fmt_apt, const char *fmt_rapt,
|
||||
const char *fmt_ev, const char *fmt_rev)
|
||||
const char *fmt_ev, const char *fmt_rev, int *limit)
|
||||
{
|
||||
llist_item_t *i;
|
||||
|
||||
LLIST_FOREACH(&day_items, i) {
|
||||
if (*limit == 0)
|
||||
break;
|
||||
struct day_item *day = LLIST_TS_GET_DATA(i);
|
||||
|
||||
switch (day->type) {
|
||||
@@ -532,6 +534,7 @@ void day_write_stdout(long date, const char *fmt_apt, const char *fmt_rapt,
|
||||
EXIT(_("unknown item type"));
|
||||
/* NOTREACHED */
|
||||
}
|
||||
(*limit)--;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user