Skip to content

Commit

Permalink
chore: improve drift table
Browse files Browse the repository at this point in the history
  • Loading branch information
flowerinthenight committed Apr 14, 2023
1 parent 46565ce commit 2a3b42f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions cmds/billing.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ func BillingAwsDriftCmd() *cobra.Command {
Use: "drift [yyyymm] [billingInternalId]",
Short: "Query differences, if any, between your AWS invoice and latest costs",
Long: `Query differences, if any, between your AWS invoice and latest costs. If [billingInternalId] is empty,
all billing groups that have diffs will be returned.`,
all billing groups that have diffs will be returned. If [yyyymm] is not provided, it will default to
the previous month.`,
Run: func(cmd *cobra.Command, args []string) {
var ret int
defer func(r *int) {
Expand All @@ -40,7 +41,7 @@ all billing groups that have diffs will be returned.`,
ret = 1
}

month = time.Now().UTC().Format("200601")
month = time.Now().UTC().AddDate(0, -1, 0).Format("200601")
if len(args) >= 1 {
mm, err := time.Parse("200601", args[0])
if err != nil {
Expand Down Expand Up @@ -156,7 +157,7 @@ all billing groups that have diffs will be returned.`,
table.SetColumnSeparator("")
table.SetTablePadding(" ")
table.SetNoWhiteSpace(true)
table.SetHeader([]string{
table.Append([]string{
"INTERNAL_ID",
"BILLING_GROUP_ID",
"ACCOUNT",
Expand Down

0 comments on commit 2a3b42f

Please sign in to comment.