-
Notifications
You must be signed in to change notification settings - Fork 431
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
Validate and log when an unrecognized parameter/flag is used #7331
Validate and log when an unrecognized parameter/flag is used #7331
Conversation
return options; | ||
} | ||
|
||
private static void ValidateCommandLineFlags(string[] args) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we are validating here I would also move GetDuplicateArguments
and duplication validation under this one method.
5d6fda4
to
db39f9e
Compare
@LukaszRozmej I've already addressed all your comments and updated the video to validate new changes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better design, but way to much allocations.
@LukaszRozmej Thanks for all the feedback provided |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool, IMO code now is quite good, would apply few final touches to make it perfect ;)
@LukaszRozmej one step closer to a better implementation |
77c0688
to
7419151
Compare
Congrats for persistence ;) |
…GetDuplicateArguments' mehtod
…ateValidConfigOptionsHash' method
… process args again
…ting intermittent arrays
…ateArguments' method
Co-authored-by: Lukasz Rozmej <lukasz.rozmej@gmail.com>
…d of List as the variable type
7419151
to
aeb937d
Compare
Co-authored-by: Lukasz Rozmej <lukasz.rozmej@gmail.com>
@LukaszRozmej Just applied changes suggested on last two comments |
@wugalde19 thank you for your contribution 🫡 |
Fails for?
🤔 |
My pleasure @LukaszRozmej |
Failed due to unrecognized argument - [JsonRpc.JwtSecretFile=C:/ethereum/jwt.hex]. |
@benaadams Please try again |
Resolves #6942
Changes
Changes made into
src/Nethermind/Nethermind.Runner/Program.cs
Run
so that we initialize the app and validate before start running most of the logic.Types of changes
What types of changes does your code introduce?
Testing
Requires testing
If yes, did you write tests?
Notes on testing
I did not see any test file for Program.cs files
Documentation
Requires documentation update
Requires explanation in Release Notes
Remarks
I recorded a video showing how it works and the error log is displayed when the argument/option/flag used is not valid and when it is valid.
Also, the cases where no flag is provided and when a default app flag (like
--help
) is provided, and when we try using duplicate argumentshttps://www.loom.com/share/0ac1011bac1247b992a9fbadba9e5b26?sid=eb48d13b-961e-490e-a1ff-5fe51a2580b0
List of commands used: