Add pattern filter option

This adds a new item filter option --filter-pattern and removes the
whole -S parameter logic, while making -S an alias for --filter-pattern.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
This commit is contained in:
Lukas Fleischer
2014-08-06 09:26:46 +02:00
parent bfe73d0e5d
commit 9ce5861468
6 changed files with 51 additions and 56 deletions

View File

@@ -152,6 +152,8 @@ struct event *event_scan(FILE * f, struct tm start, int id, char *note,
if (filter) {
if (!(filter->type_mask & TYPE_MASK_EVNT))
return NULL;
if (filter->regex && regexec(filter->regex, buf, 0, 0, 0))
return NULL;
if (filter->start_from >= 0 && tstart < filter->start_from)
return NULL;
if (filter->start_to >= 0 && tstart > filter->start_to)