Skip to content

Commit c008608

Browse files
author
jmccormick2001
committed
cleanup --output error message on pgo show cluster and pgo status commands
1 parent 7f6662e commit c008608

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

pgo/cmd/cluster.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,13 @@ func showCluster(args []string) {
5959

6060
log.Debugf("showCluster called %v\n", args)
6161

62+
if OutputFormat != "" {
63+
if OutputFormat != "json" {
64+
fmt.Println("Error: ", "json is the only supported --output format value")
65+
os.Exit(2)
66+
}
67+
}
68+
6269
log.Debug("selector is " + Selector)
6370
if len(args) == 0 && Selector != "" {
6471
args = make([]string, 1)

pgo/cmd/status.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,11 @@ func showStatus(args []string) {
5151

5252
log.Debugf("showStatus called %v\n", args)
5353

54+
if OutputFormat != "" && OutputFormat != "json" {
55+
fmt.Println("Error: json is the only supported --output-format value ")
56+
os.Exit(2)
57+
}
58+
5459
response, err := api.ShowStatus(httpclient, &SessionCredentials)
5560

5661
if err != nil {

0 commit comments

Comments
 (0)