Skip to content

Commit

Permalink
fix(cli): Output gcp comp list with --json flag (#482)
Browse files Browse the repository at this point in the history
Signed-off-by: Darren Murray <[email protected]>
  • Loading branch information
dmurray-lacework authored Jul 20, 2021
1 parent bcd81ce commit 9f95aa8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions cli/cmd/compliance_gcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ var (
rows = append(rows, []string{gcp.OrganizationID, gcp.ProjectID})
}

if cli.JSONOutput() {
return cli.OutputJSON(gcpAccounts)
}

cli.OutputHuman(renderSimpleTable([]string{"Organization ID", "Project ID"}, rows))
return nil
},
Expand Down Expand Up @@ -382,8 +386,8 @@ type cliComplianceIDAlias struct {
}

type gcpAccount struct {
ProjectID string
OrganizationID string
ProjectID string `json:"project_id"`
OrganizationID string `json:"organization_id"`
}

func extractGcpAccounts(response api.GcpIntegrationsResponse) []gcpAccount {
Expand Down

0 comments on commit 9f95aa8

Please sign in to comment.