Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: refactoring Narg checks #12814

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cli/filplus.go
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ var filplusRemoveExpiredAllocationsCmd = &cli.Command{
},
},
Action: func(cctx *cli.Context) error {
if cctx.NArg() < 1 {
if cctx.NArg() != 1 {
return IncorrectNumArgs(cctx)
}

Expand Down Expand Up @@ -638,7 +638,7 @@ var filplusRemoveExpiredClaimsCmd = &cli.Command{
},
},
Action: func(cctx *cli.Context) error {
if cctx.NArg() < 1 {
if cctx.NArg() != 1 {
return IncorrectNumArgs(cctx)
}

Expand Down
2 changes: 1 addition & 1 deletion cli/spcli/sectors.go
Original file line number Diff line number Diff line change
Expand Up @@ -1336,7 +1336,7 @@ func TerminateSectorCmd(getActorAddress ActorAddressGetter) *cli.Command {
},
},
Action: func(cctx *cli.Context) error {
if cctx.NArg() < 1 {
if cctx.NArg() != 1 {
return lcli.ShowHelp(cctx, fmt.Errorf("at least one sector must be specified"))
}

Expand Down
2 changes: 1 addition & 1 deletion cli/wallet.go
Original file line number Diff line number Diff line change
Expand Up @@ -733,7 +733,7 @@ var walletMarketAdd = &cli.Command{
afmt := NewAppFmt(cctx.App)

// Get amount param
if cctx.NArg() < 1 {
if cctx.NArg() != 1 {
return IncorrectNumArgs(cctx)
}
f, err := types.ParseFIL(cctx.Args().First())
Expand Down
2 changes: 1 addition & 1 deletion cmd/lotus-miner/proving.go
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ var provingRecoverFaultsCmd = &cli.Command{
},
},
Action: func(cctx *cli.Context) error {
if cctx.NArg() < 1 {
if cctx.NArg() != 1 {
return lcli.ShowHelp(cctx, xerrors.Errorf("must pass at least 1 sector number"))
}

Expand Down
2 changes: 1 addition & 1 deletion cmd/lotus-miner/sealing.go
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ var sealingDataCidCmd = &cli.Command{
},
},
Action: func(cctx *cli.Context) error {
if cctx.NArg() < 1 || cctx.NArg() > 2 {
if cctx.NArg() != 1 || cctx.NArg() > 2 {
return lcli.ShowHelp(cctx, xerrors.Errorf("expected 1 or 2 arguments"))
}

Expand Down
Loading