From ad21f1b972063d2543f402c04a20f32b263e60e1 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sun, 28 Sep 2025 23:56:05 +0300 Subject: fix output --- cmd/timr/main.go | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'cmd') diff --git a/cmd/timr/main.go b/cmd/timr/main.go index 4bd6025..d5b3004 100644 --- a/cmd/timr/main.go +++ b/cmd/timr/main.go @@ -6,9 +6,9 @@ import ( "strconv" "strings" - "github.com/charmbracelet/bubbletea" "codeberg.org/snonux/timr/internal/live" "codeberg.org/snonux/timr/internal/timer" + tea "github.com/charmbracelet/bubbletea" ) func main() { @@ -31,7 +31,15 @@ func runCommand(args []string) (string, error) { switch args[1] { case "start": - output, err = timer.StartTimer() + rawStatus, err := timer.GetRawStatus() + if err != nil { + return "", err + } + status, err := strconv.ParseFloat(rawStatus, 64) + if err != nil { + return "", err + } + output, err = timer.StartTimer(status > 0) case "continue": rawStatus, err := timer.GetRawStatus() if err != nil { @@ -42,7 +50,7 @@ func runCommand(args []string) (string, error) { return "", err } if status > 0 { - output, err = timer.StartTimer() + output, err = timer.StartTimer(true) } else { output = "Timer is at 0, cannot continue." } -- cgit v1.2.3