Skip to content

Commit 4b36af5

Browse files
Output format none (#234)
* Output format none * Add unit test, move const to print pkg * Switch usage of const
1 parent 65f9386 commit 4b36af5

File tree

70 files changed

+216
-110
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+216
-110
lines changed

internal/cmd/argus/grafana/describe/describe.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ func buildGetInstanceRequest(ctx context.Context, model *inputModel, apiClient *
114114

115115
func outputResult(p *print.Printer, inputModel *inputModel, grafanaConfigs *argus.GrafanaConfigs, instance *argus.GetInstanceResponse) error {
116116
switch inputModel.OutputFormat {
117-
case globalflags.PrettyOutputFormat:
117+
case print.PrettyOutputFormat:
118118
initialAdminPassword := *instance.Instance.GrafanaAdminPassword
119119
if inputModel.HidePassword {
120120
initialAdminPassword = "<hidden>"

internal/cmd/argus/instance/describe/describe.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ func buildRequest(ctx context.Context, model *inputModel, apiClient *argus.APICl
8787

8888
func outputResult(p *print.Printer, outputFormat string, instance *argus.GetInstanceResponse) error {
8989
switch outputFormat {
90-
case globalflags.PrettyOutputFormat:
90+
case print.PrettyOutputFormat:
9191

9292
table := tables.NewTable()
9393
table.AddRow("ID", *instance.Id)

internal/cmd/argus/instance/list/list.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ func buildRequest(ctx context.Context, model *inputModel, apiClient *argus.APICl
119119

120120
func outputResult(p *print.Printer, outputFormat string, instances []argus.ProjectInstanceFull) error {
121121
switch outputFormat {
122-
case globalflags.JSONOutputFormat:
122+
case print.JSONOutputFormat:
123123
details, err := json.MarshalIndent(instances, "", " ")
124124
if err != nil {
125125
return fmt.Errorf("marshal Argus instance list: %w", err)

internal/cmd/argus/plans/plans.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ func buildRequest(ctx context.Context, model *inputModel, apiClient *argus.APICl
119119

120120
func outputResult(p *print.Printer, outputFormat string, plans []argus.Plan) error {
121121
switch outputFormat {
122-
case globalflags.JSONOutputFormat:
122+
case print.JSONOutputFormat:
123123
details, err := json.MarshalIndent(plans, "", " ")
124124
if err != nil {
125125
return fmt.Errorf("marshal Argus plans: %w", err)

internal/cmd/dns/record-set/describe/describe.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ func buildRequest(ctx context.Context, model *inputModel, apiClient *dns.APIClie
103103

104104
func outputResult(p *print.Printer, outputFormat string, recordSet *dns.RecordSet) error {
105105
switch outputFormat {
106-
case globalflags.PrettyOutputFormat:
106+
case print.PrettyOutputFormat:
107107
recordsData := make([]string, 0, len(*recordSet.Records))
108108
for _, r := range *recordSet.Records {
109109
recordsData = append(recordsData, *r.Content)

internal/cmd/dns/record-set/list/list.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ func fetchRecordSets(ctx context.Context, model *inputModel, apiClient dnsClient
224224

225225
func outputResult(p *print.Printer, outputFormat string, recordSets []dns.RecordSet) error {
226226
switch outputFormat {
227-
case globalflags.JSONOutputFormat:
227+
case print.JSONOutputFormat:
228228
details, err := json.MarshalIndent(recordSets, "", " ")
229229
if err != nil {
230230
return fmt.Errorf("marshal DNS record set list: %w", err)

internal/cmd/dns/zone/describe/describe.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ func buildRequest(ctx context.Context, model *inputModel, apiClient *dns.APIClie
8888

8989
func outputResult(p *print.Printer, outputFormat string, zone *dns.Zone) error {
9090
switch outputFormat {
91-
case globalflags.PrettyOutputFormat:
91+
case print.PrettyOutputFormat:
9292
table := tables.NewTable()
9393
table.AddRow("ID", *zone.Id)
9494
table.AddSeparator()

internal/cmd/dns/zone/list/list.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ func fetchZones(ctx context.Context, model *inputModel, apiClient dnsClient) ([]
212212

213213
func outputResult(p *print.Printer, outputFormat string, zones []dns.Zone) error {
214214
switch outputFormat {
215-
case globalflags.JSONOutputFormat:
215+
case print.JSONOutputFormat:
216216
// Show details
217217
details, err := json.MarshalIndent(zones, "", " ")
218218
if err != nil {

internal/cmd/logme/credentials/describe/describe.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ func buildRequest(ctx context.Context, model *inputModel, apiClient *logme.APICl
101101

102102
func outputResult(p *print.Printer, outputFormat string, credentials *logme.CredentialsResponse) error {
103103
switch outputFormat {
104-
case globalflags.PrettyOutputFormat:
104+
case print.PrettyOutputFormat:
105105
table := tables.NewTable()
106106
table.AddRow("ID", *credentials.Id)
107107
table.AddSeparator()

internal/cmd/logme/credentials/list/list.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ func buildRequest(ctx context.Context, model *inputModel, apiClient *logme.APICl
124124

125125
func outputResult(p *print.Printer, outputFormat string, credentials []logme.CredentialsListItem) error {
126126
switch outputFormat {
127-
case globalflags.JSONOutputFormat:
127+
case print.JSONOutputFormat:
128128
details, err := json.MarshalIndent(credentials, "", " ")
129129
if err != nil {
130130
return fmt.Errorf("marshal LogMe credentials list: %w", err)

0 commit comments

Comments
 (0)