diff options
author | Péter Szilágyi <peterke@gmail.com> | 2018-12-03 18:23:57 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-03 18:23:57 +0800 |
commit | a3fd415c0f983cae35c329d97e0b6707561daef6 (patch) | |
tree | 69be088916b7863bb04b4801b2921eb2448522cd /cmd | |
parent | f850123ec7500af732b73c2501f1ef36d80ee01d (diff) | |
parent | 4825d9c3dd7d07eadfda8a6d5c18efb67df67088 (diff) | |
download | go-tangerine-a3fd415c0f983cae35c329d97e0b6707561daef6.tar.gz go-tangerine-a3fd415c0f983cae35c329d97e0b6707561daef6.tar.zst go-tangerine-a3fd415c0f983cae35c329d97e0b6707561daef6.zip |
Merge pull request #18235 from karalabe/puppeth-enforce-lowercase
cmd/puppeth: enforce lowercase network names
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/puppeth/puppeth.go | 4 | ||||
-rw-r--r-- | cmd/puppeth/wizard_intro.go | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/cmd/puppeth/puppeth.go b/cmd/puppeth/puppeth.go index f9b8fe481..df3fff51b 100644 --- a/cmd/puppeth/puppeth.go +++ b/cmd/puppeth/puppeth.go @@ -49,8 +49,8 @@ func main() { rand.Seed(time.Now().UnixNano()) network := c.String("network") - if strings.Contains(network, " ") || strings.Contains(network, "-") { - log.Crit("No spaces or hyphens allowed in network name") + if strings.Contains(network, " ") || strings.Contains(network, "-") || strings.ToLower(network) != network { + log.Crit("No spaces, hyphens or capital letters allowed in network name") } // Start the wizard and relinquish control makeWizard(c.String("network")).run() diff --git a/cmd/puppeth/wizard_intro.go b/cmd/puppeth/wizard_intro.go index 60aa0f7ff..3db9a1087 100644 --- a/cmd/puppeth/wizard_intro.go +++ b/cmd/puppeth/wizard_intro.go @@ -61,14 +61,14 @@ func (w *wizard) run() { // Make sure we have a good network name to work with fmt.Println() // Docker accepts hyphens in image names, but doesn't like it for container names if w.network == "" { - fmt.Println("Please specify a network name to administer (no spaces or hyphens, please)") + fmt.Println("Please specify a network name to administer (no spaces, hyphens or capital letters please)") for { w.network = w.readString() - if !strings.Contains(w.network, " ") && !strings.Contains(w.network, "-") { + if !strings.Contains(w.network, " ") && !strings.Contains(w.network, "-") && strings.ToLower(w.network) == w.network { fmt.Printf("\nSweet, you can set this via --network=%s next time!\n\n", w.network) break } - log.Error("I also like to live dangerously, still no spaces or hyphens") + log.Error("I also like to live dangerously, still no spaces, hyphens or capital letters") } } log.Info("Administering Ethereum network", "name", w.network) |