summaryrefslogtreecommitdiff
path: root/internal/cli/timer.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-03-03 23:42:04 +0200
committerPaul Buetow <paul@buetow.org>2026-03-03 23:42:04 +0200
commit293406c3bd2acc85490da11afabaf6733babd5e4 (patch)
tree1d3df45b9fb4511c37feaeacc885e1913e7f8ed6 /internal/cli/timer.go
parent2c414a53dc95c75584398246beb34f7ddf181448 (diff)
tui: wire real entries/report data and improve entry editing
Includes task 354 error-wrapping updates in cli/timer.go.
Diffstat (limited to 'internal/cli/timer.go')
-rw-r--r--internal/cli/timer.go16
1 files changed, 8 insertions, 8 deletions
diff --git a/internal/cli/timer.go b/internal/cli/timer.go
index 6c344e5..78d6d8d 100644
--- a/internal/cli/timer.go
+++ b/internal/cli/timer.go
@@ -41,11 +41,11 @@ func newTimerStartCmd() *cobra.Command {
RunE: func(cmd *cobra.Command, args []string) error {
rawStatus, err := timrTimer.GetRawStatus()
if err != nil {
- return err
+ return fmt.Errorf("get raw timer status: %w", err)
}
status, err := strconv.ParseFloat(rawStatus, 64)
if err != nil {
- return err
+ return fmt.Errorf("parse raw timer status %q: %w", rawStatus, err)
}
output, err := timrTimer.StartTimer(status > 0)
@@ -67,7 +67,7 @@ func newTimerStopCmd() *cobra.Command {
RunE: func(cmd *cobra.Command, args []string) error {
output, err := timrTimer.StopTimer()
if err != nil {
- return err
+ return fmt.Errorf("stop timer: %w", err)
}
if err := syncWorktimeWithTimer(false); err != nil {
return err
@@ -84,11 +84,11 @@ func newTimerContinueCmd() *cobra.Command {
RunE: func(cmd *cobra.Command, args []string) error {
rawStatus, err := timrTimer.GetRawStatus()
if err != nil {
- return err
+ return fmt.Errorf("get raw timer status: %w", err)
}
status, err := strconv.ParseFloat(rawStatus, 64)
if err != nil {
- return err
+ return fmt.Errorf("parse raw timer status %q: %w", rawStatus, err)
}
output := "Timer is at 0, cannot continue."
@@ -111,7 +111,7 @@ func newTimerResetCmd() *cobra.Command {
RunE: func(cmd *cobra.Command, args []string) error {
output, err := timrTimer.ResetTimer()
if err != nil {
- return err
+ return fmt.Errorf("reset timer: %w", err)
}
return printOutput(cmd, output)
},
@@ -163,7 +163,7 @@ func newTimerPromptCmd() *cobra.Command {
RunE: func(cmd *cobra.Command, args []string) error {
output, err := timrTimer.GetPromptStatus()
if err != nil {
- return err
+ return fmt.Errorf("get prompt timer status: %w", err)
}
return printOutput(cmd, output)
},
@@ -179,7 +179,7 @@ func newTimerTrackCmd() *cobra.Command {
description := strings.Join(args, " ")
output, err := timrTimer.TrackTime(description)
if err != nil {
- return err
+ return fmt.Errorf("track timer entry %q: %w", description, err)
}
return printOutput(cmd, output)
},