From 63b316b41f053b7f45bf9ad1a8defc2d5c0d7a84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Tue, 9 Jul 2019 15:43:21 +0200 Subject: [PATCH] Improve output from net commands --- cli/net.go | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/cli/net.go b/cli/net.go index 199ce147c..9f83e0860 100644 --- a/cli/net.go +++ b/cli/net.go @@ -28,7 +28,14 @@ var netPeers = &cli.Command{ Action: func(cctx *cli.Context) error { api := getApi(cctx) ctx := reqContext(cctx) - fmt.Println(api.NetPeers(ctx)) + peers, err := api.NetPeers(ctx) + if err != nil { + return err + } + + for _, peer := range peers { + fmt.Println(peer) + } return nil }, @@ -40,8 +47,15 @@ var netListen = &cli.Command{ Action: func(cctx *cli.Context) error { api := getApi(cctx) ctx := reqContext(cctx) - fmt.Println(api.NetAddrsListen(ctx)) + addrs, err := api.NetAddrsListen(ctx) + if err != nil { + return err + } + + for _, peer := range addrs { + fmt.Println(peer) + } return nil }, }