Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ remindctl tomorrow # show tomorrow
remindctl week # show this week
remindctl overdue # overdue
remindctl upcoming # upcoming
remindctl open # all incomplete reminders
remindctl completed # completed
remindctl all # all reminders
remindctl 2026-01-03 # specific date
Expand Down
5 changes: 5 additions & 0 deletions Sources/RemindCore/ReminderFilter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ public enum ReminderFilter: Equatable, Sendable {
case week
case overdue
case upcoming
case open
case completed
case date(Date)
case all
Expand All @@ -25,6 +26,8 @@ public enum ReminderFiltering {
return .overdue
case "upcoming", "u":
return .upcoming
case "open":
return .open
case "completed", "done", "c":
return .completed
case "all", "a":
Expand Down Expand Up @@ -76,6 +79,8 @@ public enum ReminderFiltering {
return reminders.filter { reminder in
!reminder.isCompleted && reminder.dueDate != nil
}
case .open:
return reminders.filter { !$0.isCompleted }
case .completed:
return reminders.filter { $0.isCompleted }
case .date(let date):
Expand Down
4 changes: 2 additions & 2 deletions Sources/remindctl/Commands/ShowCommand.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ enum ShowCommand {
CommandSpec(
name: "show",
abstract: "Show reminders",
discussion: "Filters: today, tomorrow, week, overdue, upcoming, completed, all, or a date string.",
discussion: "Filters: today, tomorrow, week, overdue, upcoming, open, completed, all, or a date string.",
signature: CommandSignatures.withRuntimeFlags(
CommandSignature(
arguments: [
.make(
label: "filter",
help: "today|tomorrow|week|overdue|upcoming|completed|all|<date>",
help: "today|tomorrow|week|overdue|upcoming|open|completed|all|<date>",
isOptional: true
)
],
Expand Down
1 change: 1 addition & 0 deletions Tests/RemindCoreTests/ReminderFilterParseTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ struct ReminderFilterParseTests {
#expect(ReminderFiltering.parse("w") == .week)
#expect(ReminderFiltering.parse("o") == .overdue)
#expect(ReminderFiltering.parse("u") == .upcoming)
#expect(ReminderFiltering.parse("open") == .open)
#expect(ReminderFiltering.parse("done") == .completed)
#expect(ReminderFiltering.parse("all") == .all)
}
Expand Down
10 changes: 10 additions & 0 deletions Tests/RemindCoreTests/ReminderFilteringTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,16 @@ struct ReminderFilteringTests {
#expect(result.count == 3)
}

@Test("Open filter includes no due date and excludes completed")
func openFilter() {
let now = Date(timeIntervalSince1970: 1_700_000_000)
let items = reminders(now: now)
let result = ReminderFiltering.apply(items, filter: .open, now: now, calendar: calendar)
#expect(result.count == 4)
#expect(result.contains(where: { $0.title == "No Due" }))
#expect(result.allSatisfy { !$0.isCompleted })
}

@Test("Date filter")
func dateFilter() {
let now = Date(timeIntervalSince1970: 1_700_000_000)
Expand Down
2 changes: 1 addition & 1 deletion docs/manual-tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Run on a local GUI session (not SSH-only) so the Reminders permission prompt can
- list lists: `remindctl list`
- list list contents: `remindctl list "remindctl-manual-YYYYMMDD"`
- add reminders (3 variants)
- show filters: `today`, `tomorrow`, `week`, `overdue`, `upcoming`, `completed`, `all`
- show filters: `today`, `tomorrow`, `week`, `overdue`, `upcoming`, `open`, `completed`, `all`
- edit: update title/notes/priority/due date
- complete: mark one reminder complete
- delete: remove reminders, then delete list
Expand Down