Skip to content

Commit 0a7b470

Browse files
committed
entries: list shows project & services as separate columns
1 parent c753b96 commit 0a7b470

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

cmd/entries.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,13 @@ var entriesListCommand = &cobra.Command{
8080

8181
func printEntries(entries []*mite.TimeEntry) {
8282
t := tabby.New()
83-
t.AddHeader("id", "notes", "date", "time", "project,service")
83+
t.AddHeader("id", "notes", "date", "time", "project", "service")
8484
for _, entry := range entries {
8585
trimmedNotes := strings.Replace(entry.Note, "\r\n", ",", -1)
8686
shortenedNotes := fmt.Sprintf("%.50s", trimmedNotes)
87-
shortenedProjectService := fmt.Sprintf("%.50s", entry.ProjectName+","+entry.ServiceName)
88-
t.AddLine(entry.Id, shortenedNotes, entry.Date, entry.Duration.String(), shortenedProjectService)
87+
shortenedProject := fmt.Sprintf("%.25s", entry.ProjectName)
88+
shortenedService := fmt.Sprintf("%.25s", entry.ServiceName)
89+
t.AddLine(entry.Id, shortenedNotes, entry.Date, entry.Duration.String(), shortenedProject, shortenedService)
8990
}
9091
t.Print()
9192
}

0 commit comments

Comments
 (0)