From 44031586807a9712c194995df41e20fc0a996886 Mon Sep 17 00:00:00 2001 From: Frank Date: Tue, 6 Apr 2021 11:24:32 +0800 Subject: [PATCH] add unset for set-addrs --- cmd/lotus-storage-miner/actor.go | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/cmd/lotus-storage-miner/actor.go b/cmd/lotus-storage-miner/actor.go index 94ccb0846..4897c28de 100644 --- a/cmd/lotus-storage-miner/actor.go +++ b/cmd/lotus-storage-miner/actor.go @@ -53,12 +53,21 @@ var actorSetAddrsCmd = &cli.Command{ Usage: "set gas limit", Value: 0, }, + &cli.BoolFlag{ + Name: "unset", + Usage: "unset address", + Value: false, + }, }, Action: func(cctx *cli.Context) error { args := cctx.Args().Slice() - if len(args) == 0 { + unset := cctx.Bool("unset") + if len(args) == 0 && !unset { return cli.ShowSubcommandHelp(cctx) } + if len(args) > 0 && unset { + return fmt.Errorf("unset should with no arguments") + } nodeAPI, closer, err := lcli.GetStorageMinerAPI(cctx) if err != nil { @@ -76,9 +85,6 @@ var actorSetAddrsCmd = &cli.Command{ var addrs []abi.Multiaddrs 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)