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
2 changed files with 9 additions and 1 deletions
Showing only changes of commit 208a40d3e9 - Show all commits

View File

@ -26,4 +26,5 @@ var CmdTrackedTimes = cli.Command{
&times.CmdTrackedTimesReset,
&times.CmdTrackedTimesList,
},
Flags: times.CmdTrackedTimesList.Flags,
}

View File

@ -47,6 +47,11 @@ Depending on your permissions on the repository, only your own tracked times mig
Aliases: []string{"t"},
Usage: "Print the total duration at the end",
},
&cli.BoolFlag{
Name: "mine",
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 ;)
}, flags.AllDefaultFlags...),
}
@ -60,7 +65,9 @@ func RunTimesList(cmd *cli.Context) error {
var err error
user := ctx.Args().First()
if user == "" {
if ctx.Bool("mine") {
times, _, err = client.GetMyTrackedTimes()
} else if user == "" {
// get all tracked times on the repo
times, _, err = client.ListRepoTrackedTimes(ctx.Owner, ctx.Repo, gitea.ListTrackedTimesOptions{})
} else if strings.HasPrefix(user, "#") {