fix repl output: didn't print json smaller than term height, add debug-http to api repl as well (#68)

This commit is contained in:
T. von Dein
2026-07-03 13:30:37 +02:00
parent fb6f2389fe
commit c197e138ef

View File

@@ -182,7 +182,11 @@ func pageJsonOutput(conf *cfg.Config, raw []byte) {
} else { } else {
printer.Pager("json output", output) printer.Pager("json output", output)
} }
return
} }
fmt.Println(output)
} }
func encodeAuth(username, password string) string { func encodeAuth(username, password string) string {
@@ -199,6 +203,12 @@ func CallAPI(conf *cfg.Config, verb, path, data string) ([]byte, error) {
client := &http.Client{Transport: tr} client := &http.Client{Transport: tr}
if conf.DebugHTTP {
client = &http.Client{
Transport: &cfg.DebugTransport{
Transport: tr}}
}
req, err := http.NewRequest(verb, conf.DefaultCluster.Uri+path, bytes.NewBuffer([]byte(data))) req, err := http.NewRequest(verb, conf.DefaultCluster.Uri+path, bytes.NewBuffer([]byte(data)))
if err != nil { if err != nil {
return nil, err return nil, err