From 0fe705605e4610e1b2b2ee2e4fe709f85c4def50 Mon Sep 17 00:00:00 2001 From: Frank Date: Fri, 2 Apr 2021 19:24:15 +0800 Subject: [PATCH] fix 4857: show help for set-addrs --- cmd/lotus-storage-miner/actor.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/cmd/lotus-storage-miner/actor.go b/cmd/lotus-storage-miner/actor.go index 8c2ab95bd..94ccb0846 100644 --- a/cmd/lotus-storage-miner/actor.go +++ b/cmd/lotus-storage-miner/actor.go @@ -55,6 +55,11 @@ var actorSetAddrsCmd = &cli.Command{ }, }, Action: func(cctx *cli.Context) error { + args := cctx.Args().Slice() + if len(args) == 0 { + return cli.ShowSubcommandHelp(cctx) + } + nodeAPI, closer, err := lcli.GetStorageMinerAPI(cctx) if err != nil { return err @@ -70,7 +75,10 @@ var actorSetAddrsCmd = &cli.Command{ ctx := lcli.ReqContext(cctx) var addrs []abi.Multiaddrs - for _, a := range cctx.Args().Slice() { + for _, a := range args { + if a == "nil" { + continue + } maddr, err := ma.NewMultiaddr(a) if err != nil { return fmt.Errorf("failed to parse %q as a multiaddr: %w", a, err)