mirror of
https://codeberg.org/scip/esctl.git
synced 2026-08-24 08:14:18 +02:00
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:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user