Don't register quiet flag in register.go (#299)

This clashes to Caddy, which also has its own quiet flag. Move stuff
around a bit, also to prevent cyclic imports.
This commit is contained in:
Miek Gieben
2016-09-25 18:42:08 +01:00
committed by GitHub
parent de0fa53379
commit 9b5c9df321
3 changed files with 12 additions and 10 deletions

View File

@@ -16,7 +16,6 @@ const serverType = "dns"
func init() {
flag.StringVar(&Port, "port", DefaultPort, "Default port")
flag.BoolVar(&Quiet, "quiet", false, "Quiet mode (no initialization output)")
caddy.RegisterServerType(serverType, caddy.ServerType{
Directives: func() []string { return directives },
@@ -138,7 +137,4 @@ var (
// GracefulTimeout is the maximum duration of a graceful shutdown.
GracefulTimeout time.Duration
// Quiet mode will not show any informative output on initialization.
Quiet bool
)

View File

@@ -218,7 +218,7 @@ func (s *Server) ServeDNS(w dns.ResponseWriter, r *dns.Msg) {
}
// OnStartupComplete lists the sites served by this server
// and any relevant information, assuming Quiet == false.
// and any relevant information, assuming Quiet is false.
func (s *Server) OnStartupComplete() {
if Quiet {
return
@@ -259,3 +259,8 @@ const (
tcp = 0
udp = 1
)
var (
// Quiet mode will not show any informative output on initialization.
Quiet bool
)