Don't hardwire executable names; use logical names instead
We could use `os.Args[0]` instead of hardwired names, but that ends up being e.g. `/home/weave/weaver`. So, use logical names instead.
This commit is contained in:
1 parent
b0b7649c8e
commit
0a14eb58b2
2 files changed
+3
-3
No files matched your search
+1
-1
@@ -36,7 +36,7 @@ func main() {
|
||||
flag.Parse()
|
||||
|
||||
if justVersion {
|
||||
io.WriteString(os.Stdout, fmt.Sprintf("weavedns %s\n", version))
|
||||
io.WriteString(os.Stdout, fmt.Sprintf("weave DNS %s\n", version))
|
||||
os.Exit(0)
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -59,7 +59,7 @@ func main() {
|
||||
peers = flag.Args()
|
||||
|
||||
if justVersion {
|
||||
io.WriteString(os.Stdout, fmt.Sprintf("weaver %s\n", version))
|
||||
io.WriteString(os.Stdout, fmt.Sprintf("weave router %s\n", version))
|
||||
os.Exit(0)
|
||||
}
|
||||
|
||||
@@ -136,7 +136,7 @@ func main() {
|
||||
|
||||
func handleHttp(router *weave.Router) {
|
||||
http.HandleFunc("/status", func(w http.ResponseWriter, r *http.Request) {
|
||||
io.WriteString(w, fmt.Sprintln("weaver version", version))
|
||||
io.WriteString(w, fmt.Sprintln("weave router", version))
|
||||
io.WriteString(w, router.Status())
|
||||
})
|
||||
http.HandleFunc("/connect", func(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
Reference in new issue
Block a user