Skip to content
This repository was archived by the owner on Jun 20, 2024. It is now read-only.

Commit

Permalink
Merge pull request #1324 from weaveworks/1321_elminate_misleading_fla…
Browse files Browse the repository at this point in the history
…g_parsing_error

eliminate misleading flag parsing error

Fixes #1321.
  • Loading branch information
rade committed Aug 20, 2015
2 parents f399c3a + fd6d15e commit b075e93
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions prog/weaver/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,15 @@ func main() {
mflag.IntVar(&dnsTTL, []string{"-dns-ttl"}, nameserver.DefaultTTL, "TTL for DNS request from our domain")
mflag.DurationVar(&dnsClientTimeout, []string{"-dns-fallback-timeout"}, nameserver.DefaultClientTimeout, "timeout for fallback DNS requests")

// crude way of detecting that we probably have been started in a
// container, with `weave launch` --> suppress misleading paths in
// mflags error messages.
if os.Args[0] == "/home/weave/weaver" { // matches the Dockerfile ENTRYPOINT
os.Args[0] = "weave"
mflag.CommandLine.Init("weave", mflag.ExitOnError)
}
mflag.Parse()

peers = mflag.Args()

SetLogLevel(logLevel)
Expand Down

0 comments on commit b075e93

Please sign in to comment.