add readme, improve help message

This commit is contained in:
ari melody 2025-06-08 02:27:00 +01:00
parent 8a8a8e5598
commit 3e8c6cc812
Signed by: ari
GPG key ID: CF99829C92678188
2 changed files with 30 additions and 1 deletions

10
main.go
View file

@ -295,6 +295,14 @@ func HTTPLog(next http.Handler) http.Handler {
}
func printHelp() {
fmt.Printf("%s [--host address] [--port port] [--root http_root] directory\n", os.Args[0])
fmt.Printf(
`%s [--host address] [--port port] [--root http_root] directory
--help shows this help message
--host address hosts on the specified address
--port port hosts on the specified port
--root http_root hosts on the specified subdirectory, i.e. `+"`/files/`\n",
os.Args[0],
)
os.Exit(0)
}