Skip to content

Commit 6ebcf13

Browse files
tjazerzenclaude
andcommitted
refactor: remove unsupported hourly option, add README docs
- Remove `hourly` from Recurrence enum (EventKit doesn't support it) - Remove unused `displayString` property - Add recurring reminder section to README Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 9faeefb commit 6ebcf13

3 files changed

Lines changed: 17 additions & 19 deletions

File tree

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,21 @@ $ reminders show Soon
7272
3: Something really important (priority: high)
7373
```
7474

75+
#### Add a recurring reminder
76+
77+
```
78+
$ reminders add Soon Daily standup --due-date "tomorrow 9am" --repeat daily
79+
Added 'Daily standup' to 'Soon' (repeats: daily)
80+
$ reminders add Soon Weekly review --due-date "next friday 3pm" --repeat weekly
81+
Added 'Weekly review' to 'Soon' (repeats: weekly)
82+
$ reminders show Soon
83+
0: Ship reminders-cli
84+
1: Daily standup (in 10 hours) (repeats: daily)
85+
2: Weekly review (in 4 days) (repeats: weekly)
86+
```
87+
88+
Supported values: `daily`, `weekly`, `monthly`, `yearly`
89+
7590
#### Show reminders due on or by a date
7691

7792
```

Sources/RemindersLibrary/CLI.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ private struct Add: ParsableCommand {
155155

156156
@Option(
157157
name: .shortAndLong,
158-
help: "Set a recurrence rule: hourly, daily, weekly, monthly, yearly")
158+
help: "Set a recurrence rule: daily, weekly, monthly, yearly")
159159
var `repeat`: Recurrence?
160160

161161
func run() {

Sources/RemindersLibrary/Reminders.swift

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,13 @@ public enum DisplayOptions: String, Decodable {
6565
}
6666

6767
public enum Recurrence: String, ExpressibleByArgument, CaseIterable {
68-
case hourly
6968
case daily
7069
case weekly
7170
case monthly
7271
case yearly
7372

7473
var frequency: EKRecurrenceFrequency {
7574
switch self {
76-
case .hourly: return .daily
7775
case .daily: return .daily
7876
case .weekly: return .weekly
7977
case .monthly: return .monthly
@@ -82,27 +80,12 @@ public enum Recurrence: String, ExpressibleByArgument, CaseIterable {
8280
}
8381

8482
func toRecurrenceRule() -> EKRecurrenceRule {
85-
if self == .hourly {
86-
// EventKit's public API only exposes daily/weekly/monthly/yearly.
87-
// For hourly, we use daily frequency with interval=1 as the closest
88-
// supported approximation — the reminder will repeat every day.
89-
// Users who need true hourly recurrence should set it in Reminders.app.
90-
return EKRecurrenceRule(
91-
recurrenceWith: .daily,
92-
interval: 1,
93-
end: nil
94-
)
95-
}
9683
return EKRecurrenceRule(
9784
recurrenceWith: self.frequency,
9885
interval: 1,
9986
end: nil
10087
)
10188
}
102-
103-
var displayString: String {
104-
return self.rawValue
105-
}
10689
}
10790

10891
public enum Priority: String, ExpressibleByArgument {
@@ -409,7 +392,7 @@ public final class Reminders {
409392
default:
410393
var message = "Added '\(reminder.title!)' to '\(calendar.title)'"
411394
if let recurrence = recurrence {
412-
message += " (repeats: \(recurrence.displayString))"
395+
message += " (repeats: \(recurrence.rawValue))"
413396
}
414397
print(message)
415398
}

0 commit comments

Comments
 (0)