Improve output from net commands
This commit is contained in:
parent
7069d57432
commit
63b316b41f
18
cli/net.go
18
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
|
||||
},
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user