fix 4857: show help for set-addrs
This commit is contained in:
parent
eede19fb0b
commit
0fe705605e
@ -55,6 +55,11 @@ var actorSetAddrsCmd = &cli.Command{
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
Action: func(cctx *cli.Context) error {
|
Action: func(cctx *cli.Context) error {
|
||||||
|
args := cctx.Args().Slice()
|
||||||
|
if len(args) == 0 {
|
||||||
|
return cli.ShowSubcommandHelp(cctx)
|
||||||
|
}
|
||||||
|
|
||||||
nodeAPI, closer, err := lcli.GetStorageMinerAPI(cctx)
|
nodeAPI, closer, err := lcli.GetStorageMinerAPI(cctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
@ -70,7 +75,10 @@ var actorSetAddrsCmd = &cli.Command{
|
|||||||
ctx := lcli.ReqContext(cctx)
|
ctx := lcli.ReqContext(cctx)
|
||||||
|
|
||||||
var addrs []abi.Multiaddrs
|
var addrs []abi.Multiaddrs
|
||||||
for _, a := range cctx.Args().Slice() {
|
for _, a := range args {
|
||||||
|
if a == "nil" {
|
||||||
|
continue
|
||||||
|
}
|
||||||
maddr, err := ma.NewMultiaddr(a)
|
maddr, err := ma.NewMultiaddr(a)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("failed to parse %q as a multiaddr: %w", a, err)
|
return fmt.Errorf("failed to parse %q as a multiaddr: %w", a, err)
|
||||||
|
Loading…
Reference in New Issue
Block a user