Skip to content

Commit

Permalink
include org param
Browse files Browse the repository at this point in the history
  • Loading branch information
srinandan committed Jul 27, 2022
1 parent 5abed46 commit e3904d3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
6 changes: 4 additions & 2 deletions cmd/org/reportmonthly.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ var MonthlyCmd = &cobra.Command{

if envDetails {
w := tabwriter.NewWriter(os.Stdout, 26, 4, 0, ' ', 0)
fmt.Fprintln(w, "Environment\tMonth\tAPI Calls")
fmt.Fprintln(w, "ENVIRONMENT\tMONTH\tAPI CALLS")
fmt.Fprintln(w)
w.Flush()
}
Expand All @@ -56,7 +56,7 @@ var MonthlyCmd = &cobra.Command{
}

w := tabwriter.NewWriter(os.Stdout, 26, 4, 0, ' ', 0)
fmt.Fprintln(w, "Organization\tMonth\tAPI Calls")
fmt.Fprintln(w, "ORGANIATION\tMONTH\tAPI CALLS")
fmt.Fprintf(w, "%s\t%d/%d\t%d\n", apiclient.GetApigeeOrg(), month, year, apiCalls)
fmt.Fprintln(w)
w.Flush()
Expand All @@ -78,6 +78,8 @@ func init() {
false, "Print details of each environment")
MonthlyCmd.Flags().IntVarP(&conn, "conn", "c",
4, "Number of connections")
MonthlyCmd.Flags().StringVarP(&org, "org", "o",
"", "Apigee organization name")

_ = MonthlyCmd.MarkFlagRequired("month")
_ = MonthlyCmd.MarkFlagRequired("year")
Expand Down
7 changes: 4 additions & 3 deletions cmd/org/reportyearly.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ var YearlyCmd = &cobra.Command{

if envDetails {
w := tabwriter.NewWriter(os.Stdout, 26, 4, 0, ' ', 0)
fmt.Fprintln(w, "Environment\tMonth\tAPI Calls")
fmt.Fprintln(w)
fmt.Fprintln(w, "ENVIRONMENT\tMONTH\tAPI CALLS")
w.Flush()
}

Expand All @@ -56,7 +55,7 @@ var YearlyCmd = &cobra.Command{
}

w := tabwriter.NewWriter(os.Stdout, 26, 4, 0, ' ', 0)
fmt.Fprintln(w, "Organization\tYear\tAPI Calls")
fmt.Fprintln(w, "ORGANIZATION\tYEAR\tAPI CALLS")
fmt.Fprintf(w, "%s\t%d\t%d\n", apiclient.GetApigeeOrg(), year, apiCalls)
fmt.Fprintln(w)
w.Flush()
Expand All @@ -73,6 +72,8 @@ func init() {
false, "Print details of each environment")
YearlyCmd.Flags().IntVarP(&conn, "conn", "c",
4, "Number of connections")
YearlyCmd.Flags().StringVarP(&org, "org", "o",
"", "Apigee organization name")

_ = YearlyCmd.MarkFlagRequired("year")
}

0 comments on commit e3904d3

Please sign in to comment.