aboutsummaryrefslogtreecommitdiff
path: root/cmd/server/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/server/main.go')
-rw-r--r--cmd/server/main.go14
1 files changed, 11 insertions, 3 deletions
diff --git a/cmd/server/main.go b/cmd/server/main.go
index b2a95c3..b1e53d9 100644
--- a/cmd/server/main.go
+++ b/cmd/server/main.go
@@ -37,7 +37,8 @@ func main() {
directory := fl.String("d", ".", "Directory to serve.")
version := fl.Bool("v", false, "Print the version then exit")
fl.StringVar(&page.TimeFormat, "T", page.TimeFormat, "Print the version then exit")
- indexPath := fl.String("i", "/reIndex",
+ defaultIndexPath := "/reIndex"
+ indexPath := fl.String("i", defaultIndexPath,
"Path in which, when called will rebuild the index and clear the cache")
_ = fl.Parse(os.Args[1:])
@@ -55,8 +56,15 @@ func main() {
app = &App{}
}
- app.ReIndexPath = *indexPath
- app.StaticDirectory = "static"
+ if app.ReIndexPath == "" || *indexPath != defaultIndexPath {
+ app.ReIndexPath = *indexPath
+ }
+ if app.StaticDirectory == "" {
+ app.StaticDirectory = "static"
+ }
+ if app.FeedPrefix == "" {
+ app.FeedPrefix = FeedPrefixDefault
+ }
b, _ := yaml.Marshal(app)
os.Stderr.Write(b)