about summary refs log tree commit diff
path: root/src/Main.hs
diff options
context:
space:
mode:
authorVincent Ambo <dev@tazj.in>2014-03-11T17·12+0100
committerVincent Ambo <dev@tazj.in>2014-03-11T17·12+0100
commitb4b2b053b9313b708e579310a87009ec4ff6eb43 (patch)
tree789035a266427f44f80211d0f30e68e240a2efbf /src/Main.hs
parentfef78b55fa5d6f6c42b798e298608faba9dffa73 (diff)
Updated for new options package
Diffstat (limited to 'src/Main.hs')
-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