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

cmd/utils: Disallow --lightserv in light mode #15514

Merged
merged 3 commits into from
Nov 24, 2017
Merged

Conversation

tsarpaul
Copy link
Contributor

@GitCop
Copy link

GitCop commented Nov 18, 2017

Thank you for your contribution! Your commits seem to not adhere to the repository coding standards

  • Commit: 93cf78078e57f29145dd9666fb88afa5dfd753fe
  • Commits must be prefixed with the package(s) they modify

Please check the contribution guidelines for more details.


This message was auto-generated by https://gitcop.com

@tsarpaul tsarpaul changed the title Disallow --lightserv in light mode cmd/utils: Disallow --lightserv in light mode Nov 18, 2017
@GitCop
Copy link

GitCop commented Nov 18, 2017

Thank you for your contribution! Your commits seem to not adhere to the repository coding standards

  • Commit: 93cf78078e57f29145dd9666fb88afa5dfd753fe

  • Commits must be prefixed with the package(s) they modify

  • Commit: 2f86c1d69d841723e012381f0c53ea940a07fb44

  • Commits must be prefixed with the package(s) they modify

Please check the contribution guidelines for more details.


This message was auto-generated by https://gitcop.com

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.

Sweet, just a couple of polishes and it's good to go.

if ctx.GlobalIsSet(flag.GetName()) {
set = append(set, "--"+flag.GetName())
for i, arg := range args {
if flag, ok := arg.(cli.Flag); ok {
Copy link
Member

Choose a reason for hiding this comment

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

Minor suggestion, instead of nesting when the condition holds, let's continue when it doens't hold. This reduces the nesting depth of the entire code by one level:

flag, ok := arg.(cli.Flag)
if !ok {
	continue;
}

set = append(set, `"--`+flag.GetName()+` `+option+`"`)
}
default:
Fatalf("Received wrong type in checkExclusive")
Copy link
Member

Choose a reason for hiding this comment

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

I think a panic here would be better. It shouts louder that something was coded wrong:

panic("unsupported flag argument type")

@karalabe karalabe added this to the 1.8.0 milestone Nov 23, 2017
@GitCop
Copy link

GitCop commented Nov 24, 2017

Thank you for your contribution! Your commits seem to not adhere to the repository coding standards

  • Commit: ce45110

  • Commits must be prefixed with the package(s) they modify

  • Commit: 642612c

  • Commits must be prefixed with the package(s) they modify

Please check the contribution guidelines for more details.


This message was auto-generated by https://gitcop.com

@GitCop
Copy link

GitCop commented Nov 24, 2017

Thank you for your contribution! Your commits seem to not adhere to the repository coding standards

  • Commit: ce45110

  • Commits must be prefixed with the package(s) they modify

  • Commit: 642612c

  • Commits must be prefixed with the package(s) they modify

Please check the contribution guidelines for more details.


This message was auto-generated by https://gitcop.com

@karalabe karalabe merged commit e4c9fd2 into ethereum:master Nov 24, 2017
@rkeene
Copy link

rkeene commented Mar 19, 2018

This change appears to disallow all use of --syncmode with --lightserv.

$ geth --syncmode="full" --port="30303" --lightserv=50 --cache=4096 --maxpeers=128
Fatal: Flags --lightserv, --syncmode can't be used at the same time

Due to the change here:

checkExclusive(ctx, LightServFlag, SyncModeFlag, "light")

Since checkExclusive does not discard the option from matching with respect to the string argument (the string argument, "light", only affects the formatting of the error message)

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.

None yet

4 participants