-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Some Lotus CLI commands don't enforce number of arguments #12790
Comments
would like to take this up! |
Great, consider it yours @ameeetgaikwad! I don't know how many commands are in this situation so this is going to require a manual walk through the
|
@ameeetgaikwad I assigned the issue to you, and set its status to "In Progress". Let us know if you have any questions with regards to the issue, or need help to get unblocked on any techincal matters |
Hey @ameeetgaikwad! I was just wondering if you had any progress on the fix for this issue, or any questions related to it? |
@rjan90 hello ser! Pusing by eod |
Ref: #12788
lotus/cli/wallet.go
Lines 735 to 739 in 7f2068e
lotus wallet add
does a< 1
check onNArg()
, but it really should be!= 1
to match the usage<amount>
. This would pick up any mis-use, like supplying the options too late (thinking that it's got GNU CLI flexibility when it's unfortunately Go's frustrating typical BSD CLI inflexibility). I haven't looked but it's likely that there are more in here with this same problem.Marking this job as
good first issue
because it's really just a fairly straightforward audit; walking through all of the commands attached to thelotus
CLI (we'll scope it to that for now) and checking thatNArgs
is being properly enforced to match the usage (or vice versa).Ideally the CLI package should be able to understand its usage string and enforce that, or maybe we could come up with our own usage string parser (e.g.
"<foo> [bar] [baz]" should have >=1 && <=3
); but that could be a later-job and for now just getting them matched would be good.The text was updated successfully, but these errors were encountered: