Skip to content

Commit c5054d8

Browse files
authored
Fix mapping of default output type to json (#93)
1 parent 7055f8d commit c5054d8

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

cmd/output.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,8 @@ func printResult(outputType string, response map[string]interface{}, filter []st
254254
printCsv(response, filter)
255255
case config.TABLE:
256256
printTable(response, filter)
257+
case config.DEFAULT:
258+
printJSON(response)
257259
default:
258260
fmt.Println("Invalid output type configured, please fix that!")
259261
}

config/config.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ const (
4040
JSON = "json"
4141
TABLE = "table"
4242
TEXT = "text"
43+
DEFAULT= "default"
4344
)
4445

4546
// ServerProfile describes a management server
@@ -75,7 +76,7 @@ type Config struct {
7576
}
7677

7778
func GetOutputFormats() []string {
78-
return []string {"column", "csv", "json", "table", "text"}
79+
return []string {"column", "csv", "json", "table", "text", "default"}
7980
}
8081

8182
func CheckIfValuePresent(dataset []string, element string) bool {

0 commit comments

Comments
 (0)