add readme, improve help message
This commit is contained in:
parent
8a8a8e5598
commit
3e8c6cc812
2 changed files with 30 additions and 1 deletions
21
README.md
Normal file
21
README.md
Normal file
|
@ -0,0 +1,21 @@
|
|||
# indir
|
||||
|
||||
a nifty static file indexer
|
||||
|
||||
indir provides a nice, simple frontend for browsing your web directories!
|
||||
heavily inspired by traditional file indexers provided by the likes of nginx
|
||||
and apache, with some modern amenities on top :)
|
||||
|
||||
## usage
|
||||
```sh
|
||||
indir [--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/`
|
||||
```
|
||||
|
||||
## to-do:
|
||||
- [ ] directory header from readme file
|
||||
- [ ] directory stylesheet overrides
|
10
main.go
10
main.go
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue