diff options
-rw-r--r-- | server.go | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -414,6 +414,7 @@ func main() { var dirRoot string var help, version bool var port = -1 + var host string helpString := `This is the help` versionString := "0.0.0" @@ -425,9 +426,12 @@ func main() { usageDir = "the directory to serve" usageHelp = "show some help" usageVersion = "show the version" + usageHost = "select the host adress" ) flag.StringVar(&dirRoot, "directory", "", usageDir) - flag.StringVar(&dirRoot, "d", "", usageDir + " (shorthand)") + flag.StringVar(&dirRoot, "d", "localhost", usageHost + " (shorthand)") + flag.StringVar(&host, "hostname", "", usageHost) + flag.StringVar(&host, "H", "", usageHost + " (shorthand)") flag.IntVar(&port, "port", 0, portUsage) flag.IntVar(&port, "p", 0, portUsage + " (shorthand)") flag.BoolVar(&help, "help", false, usageHelp) @@ -467,6 +471,9 @@ func main() { dirRoot = defaultRoot } } + if host != "" { + config.Config.Hostnames = []string{host} + } fmap := template.FuncMap{ "formatURL": encodeURL, |