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

client: validate CLI args #2490

Merged
merged 1 commit into from
Jan 19, 2023
Merged

client: validate CLI args #2490

merged 1 commit into from
Jan 19, 2023

Conversation

gabrocheleau
Copy link
Contributor

This PR makes the CLI args parsing strict, meaning that unknown args will result in yargs throwing instead of them being ignored.

npm run client:start -- --invalidOption now results in:

image

@gabrocheleau
Copy link
Contributor Author

@holgerd77, do you think it's worth writing a test for this? I'm tempted to leave testing out, as we'd basically just be testing yargs behavior.

@codecov
Copy link

codecov bot commented Jan 19, 2023

Codecov Report

Merging #2490 (16dc231) into master (6508bf9) will decrease coverage by 0.04%.
The diff coverage is n/a.

Additional details and impacted files

Impacted file tree graph

Flag Coverage Δ
block 89.50% <ø> (ø)
blockchain 90.04% <ø> (ø)
client 87.91% <ø> (ø)
common 95.89% <ø> (ø)
devp2p 91.48% <ø> (-0.14%) ⬇️
ethash ∅ <ø> (?)
rlp ∅ <ø> (∅)
statemanager 89.61% <ø> (ø)
trie 90.02% <ø> (-0.35%) ⬇️
tx 97.80% <ø> (ø)
util 85.11% <ø> (ø)
vm 85.85% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Copy link
Member

@holgerd77 holgerd77 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, that's fantastic! 🤩 Just tested with --rpcdebug (instead of --rpcDebug), works perfectly with then directly giving the help page (makes so much sense).

Sometimes the small changes are the best! 🙂

Will likely find a lot of other client UX improvement suggestions during interop 😋!

Will merge (no, don't think a test is required here).

@holgerd77 holgerd77 merged commit 3ec8845 into master Jan 19, 2023
@holgerd77 holgerd77 deleted the client/validate-cli-args branch January 19, 2023 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants