From 492ff3812fc7fa6d772c1a258f5c837f7e7ff37f Mon Sep 17 00:00:00 2001 From: snomiao Date: Tue, 17 Feb 2026 11:18:31 +0000 Subject: [PATCH] feat: add --nodeclined support to remind command (ported from insanum#636) Wire output_parser (which includes --nodeclined/ignore_declined) into the remind subparser and apply the existing _DeclinedEvent() filter pattern inside Remind() to skip declined events. The original PR only added a dead parameter; this implementation uses the existing self.options['ignore_declined'] pattern consistent with all other commands that respect --nodeclined. Co-Authored-By: Gustavo Porto Co-Authored-By: Claude Sonnet 4.5 --- gcalcli/argparsers.py | 2 +- gcalcli/gcal.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/gcalcli/argparsers.py b/gcalcli/argparsers.py index 478f28a..9ed634d 100644 --- a/gcalcli/argparsers.py +++ b/gcalcli/argparsers.py @@ -715,7 +715,7 @@ def get_argument_parser(): default_cmd = 'notify-send -u critical -i appointment-soon -a gcalcli %s' remind = sub.add_parser( 'remind', - parents=[calendars_parser], + parents=[calendars_parser, output_parser], help='execute command if event occurs within time', description='Execute if event occurs within ; the %s ' 'in is replaced with event start time and title text.' diff --git a/gcalcli/gcal.py b/gcalcli/gcal.py index aa63820..3abd559 100644 --- a/gcalcli/gcal.py +++ b/gcalcli/gcal.py @@ -1541,6 +1541,9 @@ def Remind(self, minutes, command, use_reminders=False): if event['s'] < self.now: continue + if self.options['ignore_declined'] and self._DeclinedEvent(event): + continue + # not sure if 'reminders' always in event if use_reminders and 'reminders' in event \ and 'overrides' in event['reminders']: