diff options
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/run.go | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -1,6 +1,7 @@ package caddycmd import ( + "flag" "log" "bitbucket.org/lightcodelabs/caddy2" @@ -8,14 +9,18 @@ import ( // Main executes the main function of the caddy command. func Main() { - addr := ":1234" // TODO: for dev only - err := caddy2.StartAdmin(addr) + flag.Parse() + + err := caddy2.StartAdmin(*listenAddr) if err != nil { log.Fatal(err) } defer caddy2.StopAdmin() - log.Println("Caddy 2 admin endpoint listening on", addr) + log.Println("Caddy 2 admin endpoint listening on", *listenAddr) select {} } + +// TODO: for dev only +var listenAddr = flag.String("listen", ":1234", "The admin endpoint listener address") |