From e26089b6fb7030e3ba8be314c37603453520d2d4 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Thu, 26 Jun 2025 23:03:57 +0300 Subject: feat: Add raw and rawm status options This commit introduces two new options for the Status: Stopped Elapsed Time: 0s command: - 0: Displays the elapsed time in seconds. - 0: Displays the elapsed time in minutes. Unit tests have been added for both new functionalities, and the has been updated to reflect these changes. The status test has also been refactored to be more robust and less prone to flakiness by directly manipulating the timer state instead of relying on . --- cmd/timr/main.go | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'cmd') diff --git a/cmd/timr/main.go b/cmd/timr/main.go index 0625070..442e48c 100644 --- a/cmd/timr/main.go +++ b/cmd/timr/main.go @@ -24,7 +24,19 @@ func main() { case "stop", "pause": output, err = timer.StopTimer() case "status": - output, err = timer.GetStatus() + if len(os.Args) > 2 { + switch os.Args[2] { + case "raw": + output, err = timer.GetRawStatus() + case "rawm": + output, err = timer.GetRawMinutesStatus() + default: + printUsage() + os.Exit(1) + } + } else { + output, err = timer.GetStatus() + } case "reset": output, err = timer.ResetTimer() case "prompt": -- cgit v1.2.3