tme

Toggl like Time Manager
git clone git://gtms.dev:tme
Log | Files | Refs

commit f89d3751b16fbf52582c3a1fe588d0156f1a21bb
parent 6304741cb9c7d9fd0749ec6bb2a439a5ac923198
Author: Tomas Nemec <nemi@skaut.cz>
Date:   Sat, 11 Feb 2023 00:46:04 +0100

refactor

Diffstat:
Mcommand.go | 11++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/command.go b/command.go @@ -250,16 +250,17 @@ func formatEntry(group tme.Group, entry tme.Entry) { duration := entry.Duration().Round(time.Second) timeLayout := "15:04 02/01/2006" + var start, stop string switch e := entry.(type) { case tme.CompletedEntry: - var start string start = e.Start.Format(timeLayout) - stop := e.Stop.Format(timeLayout) - fmt.Printf("%s\t%s\t%v\t%s\n", groupPath, start, stop, duration) + stop = e.Stop.Format(timeLayout) case tme.RunningEntry: - start := e.Start.Format(timeLayout) - fmt.Printf("%s\t%s\t%s\t%s\n", groupPath, start, "running", duration) + start = e.Start.Format(timeLayout) + stop = "running" } + + fmt.Printf("%s\t%s\t%v\t%s\n", groupPath, start, stop, duration) } func groupsRecursive(rootPath string, groupPath string) ([]tme.Group, error) {