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

Prevent usage of invalid command or bootnodes #17248

Merged
merged 2 commits into from
Jul 26, 2018
Merged

Conversation

aerth
Copy link
Contributor

@aerth aerth commented Jul 26, 2018

Adds two fatal startup errors, to prevent unintended behavior due to invalid flag usage.

  • bootnode is not able to be parsed
  • command is not recognized

@karalabe
Copy link
Member

What's the daemon thing? Geth can work fine with just argument flags, it doesn't need a subcommand.

@aerth
Copy link
Contributor Author

aerth commented Jul 26, 2018

ah yes. in that case, it can be reduced to if len(ctx.Args()) > 0

Here is the check: geth -fast test and geth test -fast

Since test is not a subcommand, both should fail IMO

@karalabe
Copy link
Member

Very nice, now I understand what this PR is for :) I really wanted to have this for a long time, thank you for solving it this elegantly.

Copy link
Member

@karalabe karalabe left a comment

Choose a reason for hiding this comment

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

LGTM

@karalabe karalabe merged commit 021d6fb into ethereum:master Jul 26, 2018
@karalabe karalabe added this to the 1.8.13 milestone Jul 26, 2018
firmianavan pushed a commit to firmianavan/go-ethereum that referenced this pull request Aug 28, 2018
* cmd: stop parsing bootnodes if one is invalid

* cmd/geth: require valid command as argument (or no arg)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants