0
Fork 0
mirror of https://github.com/caddyserver/caddy.git synced 2024-12-23 22:27:38 -05:00

Shows site addresses at start; new -quiet flag

This commit is contained in:
Matthew Holt 2015-04-23 13:28:05 -06:00
parent d088194585
commit dd3ff0fcb5

15
main.go
View file

@ -13,19 +13,20 @@ import (
var (
conf string
http2 bool
http2 bool // TODO: temporary flag until http2 is standard
quiet bool
)
func init() {
flag.StringVar(&conf, "conf", config.DefaultConfigFile, "the configuration file to use")
flag.BoolVar(&http2, "http2", true, "enable HTTP/2 support") // temporary flag until http2 merged into std lib
flag.BoolVar(&http2, "http2", true, "enable HTTP/2 support") // TODO: temporary flag until http2 merged into std lib
flag.BoolVar(&quiet, "quiet", false, "quiet mode (no initialization output)")
flag.Parse()
}
func main() {
var wg sync.WaitGroup
flag.Parse()
// Load config from file
allConfigs, err := config.Load(conf)
if err != nil {
@ -60,6 +61,12 @@ func main() {
log.Println(err)
}
}(s)
if !quiet {
for _, config := range configs {
fmt.Printf("%s -> OK\n", config.Address())
}
}
}
wg.Wait()