Skip to content
This repository has been archived by the owner on Jan 2, 2024. It is now read-only.

Commit

Permalink
cmd/tier: accept --at flag for report
Browse files Browse the repository at this point in the history
  • Loading branch information
bmizerany committed Jul 13, 2023
1 parent bf5b350 commit 6bf2a4f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions cmd/tier/tier.go
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,7 @@ func runTier(cmd string, args []string) (err error) {
case "report":
fs := flag.NewFlagSet(cmd, flag.ExitOnError)
clobber := fs.Bool("clobber", false, "clobber existing value")
fat := fs.String("at", "", "clobber existing value")
if err := fs.Parse(args); err != nil {
return err
}
Expand All @@ -417,7 +418,16 @@ func runTier(cmd string, args []string) (err error) {
if err != nil {
return err
}
var at time.Time
if *fat != "" {
nsecs, err := strconv.ParseInt(*fat, 10, 64)
if err != nil {
return err
}
at = time.Unix(nsecs, 0)
}
return tc().ReportUsage(ctx, org, feature, n, &tier.ReportParams{
At: at,
Clobber: *clobber,
})
case "whoami":
Expand Down

0 comments on commit 6bf2a4f

Please sign in to comment.