mirror of
https://codeberg.org/scip/esctl.git
synced 2026-08-24 03:24:19 +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 {
|
||||
printer.Pager("json output", output)
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
fmt.Println(output)
|
||||
}
|
||||
|
||||
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}
|
||||
|
||||
if conf.DebugHTTP {
|
||||
client = &http.Client{
|
||||
Transport: &cfg.DebugTransport{
|
||||
Transport: tr}}
|
||||
}
|
||||
|
||||
req, err := http.NewRequest(verb, conf.DefaultCluster.Uri+path, bytes.NewBuffer([]byte(data)))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
Reference in New Issue
Block a user