summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--server.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/server.go b/server.go
index 820a21a..eab1e75 100644
--- a/server.go
+++ b/server.go
@@ -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,