Improve tea time #319

Merged
lunny merged 6 commits from noerw/tea:better-times-are-coming into master 2020-12-23 04:58:36 +00:00
Showing only changes of commit 0a60c44263 - Show all commits

View File

@ -5,6 +5,7 @@
package times
import (
"fmt"
"strings"
"time"
@ -52,6 +53,12 @@ Depending on your permissions on the repository, only your own tracked times mig
Aliases: []string{"m"},
Usage: "Show Print the total duration at the end",
noerw marked this conversation as resolved Outdated
Outdated
Review

cp issue ;)

cp issue ;)
},
&cli.StringFlag{
Name: "fields",
Usage: fmt.Sprintf(`Comma-separated list of fields to print. Available values:
%s
`, strings.Join(print.TrackedTimeFields, ",")),
},
}, flags.AllDefaultFlags...),
}
@ -107,6 +114,12 @@ func RunTimesList(cmd *cli.Context) error {
return err
}
if ctx.IsSet("fields") {
if fields, err = flags.GetFields(cmd, print.TrackedTimeFields); err != nil {
return err
}
}
print.TrackedTimesList(times, ctx.Output, fields, ctx.Bool("total"))
return nil
}