format console api command response

This commit is contained in:
Radu Ioan Fericean
2013-11-29 19:02:47 +02:00
parent 453f4c9f33
commit 69200d00e8

View File

@@ -22,8 +22,10 @@ import (
"encoding/json"
"flag"
"fmt"
"github.com/cgrates/cgrates/console"
"github.com/cgrates/cgrates/utils"
"log"
"net/rpc"
"net/rpc/jsonrpc"
@@ -64,7 +66,7 @@ func main() {
if rpcErr := client.Call(cmd.RpcMethod(), cmd.RpcParams(), res); rpcErr != nil {
fmt.Println("Error executing command: " + rpcErr.Error())
}
result, _ := json.Marshal(res)
result, _ := json.MarshalIndent(res, "", " ")
fmt.Println(string(result))
}