Skip to content

Commit 2230b7f

Browse files
snomiaoportothreeclaude
authored
feat: add --nodeclined support to remind command (ported from insanum#636) (#9)
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 <gustavo@portosanti.com> Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent b62647b commit 2230b7f

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

gcalcli/argparsers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -727,7 +727,7 @@ def get_argument_parser():
727727
default_cmd = 'notify-send -u critical -i appointment-soon -a gcalcli %s'
728728
remind = sub.add_parser(
729729
'remind',
730-
parents=[calendars_parser],
730+
parents=[calendars_parser, output_parser],
731731
help='execute command if event occurs within <mins> time',
732732
description='Execute <cmd> if event occurs within <mins>; the %s '
733733
'in <command> is replaced with event start time and title text.'

gcalcli/gcal.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1555,6 +1555,9 @@ def Remind(self, minutes, command, use_reminders=False):
15551555
if event['s'] < self.now:
15561556
continue
15571557

1558+
if self.options['ignore_declined'] and self._DeclinedEvent(event):
1559+
continue
1560+
15581561
# not sure if 'reminders' always in event
15591562
if use_reminders and 'reminders' in event \
15601563
and 'overrides' in event['reminders']:

0 commit comments

Comments
 (0)