Enhanced output of finish command
This commit is contained in:
parent
6b3554eadb
commit
21584d2680
1 changed files with 6 additions and 3 deletions
|
@ -59,12 +59,15 @@ var finishCmd = &cobra.Command{
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
trackDiff := runningEntry.Finish.Sub(runningEntry.Begin)
|
||||||
|
trackDiffOut := time.Time{}.Add(trackDiff)
|
||||||
|
|
||||||
if runningEntry.Task != "" && runningEntry.Project != "" {
|
if runningEntry.Task != "" && runningEntry.Project != "" {
|
||||||
fmt.Printf("□ finished tracking %s on %s\n", color.FgLightWhite.Render(runningEntry.Task), color.FgLightWhite.Render(runningEntry.Project))
|
fmt.Printf("□ finished tracking %s on %s for %sh\n", color.FgLightWhite.Render(runningEntry.Task), color.FgLightWhite.Render(runningEntry.Project), trackDiffOut.Format("15:04"))
|
||||||
} else if runningEntry.Task != "" && runningEntry.Project == "" {
|
} else if runningEntry.Task != "" && runningEntry.Project == "" {
|
||||||
fmt.Printf("□ finished tracking %s\n", color.FgLightWhite.Render(runningEntry.Task))
|
fmt.Printf("□ finished tracking %s for %sh\n", color.FgLightWhite.Render(runningEntry.Task), trackDiffOut.Format("15:04"))
|
||||||
} else if runningEntry.Task == "" && runningEntry.Project != "" {
|
} else if runningEntry.Task == "" && runningEntry.Project != "" {
|
||||||
fmt.Printf("□ finished tracking task on %s\n", color.FgLightWhite.Render(runningEntry.Project))
|
fmt.Printf("□ finished tracking task on %s for %sh\n", color.FgLightWhite.Render(runningEntry.Project), trackDiffOut.Format("15:04"))
|
||||||
} else {
|
} else {
|
||||||
fmt.Printf("□ finished tracking task\n")
|
fmt.Printf("□ finished tracking task\n")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue