Skip to content

Commit b88dbfc

Browse files
committed
feat: Support format in hapi.yaml
1 parent 67ad8c3 commit b88dbfc

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

output/output.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package output
33
import (
44
"fmt"
55
"github.com/spf13/cobra"
6+
"github.com/spf13/viper"
67
"log"
78
"net/http"
89
"os"
@@ -18,7 +19,12 @@ func Format(cmd *cobra.Command, body []byte, statusCode int) {
1819
fmt.Println(string(body))
1920
os.Exit(1)
2021
}
21-
22+
if format == "" {
23+
val := viper.GetString("format")
24+
if val != "" {
25+
format = val
26+
}
27+
}
2228
switch format {
2329
default:
2430
printTable(body)

0 commit comments

Comments
 (0)