From a686809bf086d73e5ec6779d42e5274090c71258 Mon Sep 17 00:00:00 2001 From: zenground0 Date: Fri, 1 Jul 2022 12:31:38 -0500 Subject: [PATCH] disconnect just takes pid --- cli/net.go | 14 ++++++-------- documentation/en/cli-lotus-miner.md | 2 +- documentation/en/cli-lotus.md | 2 +- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/cli/net.go b/cli/net.go index 8d47ba910a6..7167394f996 100644 --- a/cli/net.go +++ b/cli/net.go @@ -265,7 +265,7 @@ var NetListen = &cli.Command{ var NetDisconnect = &cli.Command{ Name: "disconnect", Usage: "Disconnect from a peer", - ArgsUsage: "[peerMultiaddr|minerActorAddress]", + ArgsUsage: "[peerID]", Action: func(cctx *cli.Context) error { api, closer, err := GetAPI(cctx) if err != nil { @@ -274,13 +274,11 @@ var NetDisconnect = &cli.Command{ defer closer() ctx := ReqContext(cctx) - pis, err := AddrInfoFromArg(ctx, cctx) - if err != nil { - return err - } - for _, pi := range pis { - fmt.Printf("disconnect %s: ", pi.ID.Pretty()) - err := api.NetDisconnect(ctx, pi.ID) + ids := cctx.Args().Slice() + for _, id := range ids { + pid := peer.ID(id) + fmt.Printf("disconnect %s: ", pid.Pretty()) + err := api.NetDisconnect(ctx, pid) if err != nil { fmt.Println("failure") return err diff --git a/documentation/en/cli-lotus-miner.md b/documentation/en/cli-lotus-miner.md index e825ec83a6a..2e72af4a822 100644 --- a/documentation/en/cli-lotus-miner.md +++ b/documentation/en/cli-lotus-miner.md @@ -1235,7 +1235,7 @@ NAME: lotus-miner net disconnect - Disconnect from a peer USAGE: - lotus-miner net disconnect [command options] [peerMultiaddr|minerActorAddress] + lotus-miner net disconnect [command options] [peerID] OPTIONS: --help, -h show help (default: false) diff --git a/documentation/en/cli-lotus.md b/documentation/en/cli-lotus.md index cba93bf9982..83dcfb25d3a 100644 --- a/documentation/en/cli-lotus.md +++ b/documentation/en/cli-lotus.md @@ -2552,7 +2552,7 @@ NAME: lotus net disconnect - Disconnect from a peer USAGE: - lotus net disconnect [command options] [peerMultiaddr|minerActorAddress] + lotus net disconnect [command options] [peerID] OPTIONS: --help, -h show help (default: false)