From 740d588381ac5be4e3a5b76551a0b916511214ac Mon Sep 17 00:00:00 2001 From: "Brian (bex) Exelbierd" Date: Wed, 20 Jan 2016 15:39:45 +0100 Subject: [PATCH 1/2] Adding -oa --onlyAllDayEvents Print only All Day Events --- icalBuddyArgs.m | 2 ++ icalBuddyDefines.h | 3 ++- icalBuddyFunctions.m | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/icalBuddyArgs.m b/icalBuddyArgs.m index dfd09a4..496a3ca 100644 --- a/icalBuddyArgs.m +++ b/icalBuddyArgs.m @@ -77,6 +77,8 @@ void handleArgument(NSString *shortName, NSString *longName, id value, opts->alwaysShowTodaysSection = YES; else if ([shortName isEqualToString:@"ea"] || [longName isEqualToString:@"excludeAllDayEvents"]) opts->excludeAllDayEvents = YES; + else if ([shortName isEqualToString:@"oa"] || [longName isEqualToString:@"onlyAllDayEvents"]) + opts->onlyAllDayEvents = YES; } // value-requiring arguments diff --git a/icalBuddyDefines.h b/icalBuddyDefines.h index 108a93d..c5f4acd 100644 --- a/icalBuddyDefines.h +++ b/icalBuddyDefines.h @@ -144,6 +144,7 @@ typedef struct BOOL alwaysShowTodaysSection; BOOL specificCalFilterPrecedesCalTypeFilter; BOOL excludeAllDayEvents; + BOOL onlyAllDayEvents; BOOL output_is_uncompletedTasks; BOOL output_is_eventsToday; @@ -171,7 +172,7 @@ typedef struct NSUInteger maxNumNoteCharacters; } AppOptions; -#define NEW_DEFAULT_APP_OPTIONS {NO,NO,NO,NO,NO,NO,NO,NO,NO,NO,NO,NO,NO,NO,NO,NO,NO,NO,NO,NO,NO,\ +#define NEW_DEFAULT_APP_OPTIONS {NO,NO,NO,NO,NO,NO,NO,NO,NO,NO,NO,NO,NO,NO,NO,NO,NO,NO,NO,NO,NO,NO,\ nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,0,0} diff --git a/icalBuddyFunctions.m b/icalBuddyFunctions.m index f01283a..1c71465 100644 --- a/icalBuddyFunctions.m +++ b/icalBuddyFunctions.m @@ -134,6 +134,9 @@ BOOL areWePrintingAlsoPastEvents(AppOptions *opts) if (opts->excludeAllDayEvents) ret = [ret filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:@"isAllDay == NO"]]; + if (opts->onlyAllDayEvents) + ret = [ret filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:@"isAllDay == YES"]]; + return ret; } From 76d12444150a60d098387c221ec5453065df3033 Mon Sep 17 00:00:00 2001 From: Gale Fagan Date: Fri, 24 Jan 2020 23:17:35 -0800 Subject: [PATCH 2/2] Added usage statement to -oa/--onlyAllDayEvents. Also added to docs. --- icalBuddy.m | 1 + icalBuddy.pod | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/icalBuddy.m b/icalBuddy.m index a908d61..fcb7202 100644 --- a/icalBuddy.m +++ b/icalBuddy.m @@ -230,6 +230,7 @@ int main(int argc, char *argv[]) @"-nrd No relative dates\n" @"-npn No property names\n" @"-n Include only events from now on\n" + @"-oa Only output all-day events\n" @"-sed Show empty dates\n" @"-uid Show event/task UIDs\n" @"-eed Exclude end datetimes\n" diff --git a/icalBuddy.pod b/icalBuddy.pod index 86e9542..091ad04 100644 --- a/icalBuddy.pod +++ b/icalBuddy.pod @@ -132,6 +132,10 @@ Omit property names from the output (i.e. only show property values -- e.g. "My If the I value C is used, only output events that occur between the current time and the end of the day (as opposed to events that occur between the start and end of the day, as by default.) +=item B<-oa>, B<--onlyAllDayEvents> + +Only output all-day events. + =item B<-na>, B<--maxNumAttendees> Maximum number of attendees to show for events.