about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/Main.hs17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/Main.hs b/src/Main.hs
index 88bf59121eac..a684db4e052a 100644
--- a/src/Main.hs
+++ b/src/Main.hs
@@ -42,12 +42,17 @@ import           RSS
 
 {- Server -}
 
-defineOptions "MainOptions" $ do
-  stringOption "optState" "statedir" "../"
-    "Directory in which the /BlogState dir is located.\
-    \ The default is ../ (if run from src/)"
-  intOption "optPort" "port" 8000
-    "The port to run the web server on. Default is 8000"
+data MainOptions = MainOptions {
+  optState :: String,
+  optPort  :: Int
+}
+
+instance Options MainOptions where
+  defineOptions = pure MainOptions
+    <*> simpleOption "statedir" "/var/tazblog/"
+        "Directory in which the BlogState is located."
+    <*> simpleOption "port" 8000
+        "Port to run on. Default is 8000."
 
 tmpPolicy :: BodyPolicy
 tmpPolicy = defaultBodyPolicy "./tmp/" 0 200000 1000