aboutsummaryrefslogtreecommitdiff
path: root/src/Chelleport.hs
diff options
context:
space:
mode:
authorAkshay Nair <phenax5@gmail.com>2024-12-28 13:09:21 +0530
committerAkshay Nair <phenax5@gmail.com>2024-12-28 13:53:44 +0530
commitd6dbe32df6f1a01c95f9293023e2d73872fa39fe (patch)
treed9a9e667eef416c03745a054118f21ed84ad49e9 /src/Chelleport.hs
parent98af698a806e41904368c0114f9d8d9f377d9c09 (diff)
downloadchelleport-d6dbe32df6f1a01c95f9293023e2d73872fa39fe.tar.gz
chelleport-d6dbe32df6f1a01c95f9293023e2d73872fa39fe.zip
Add cli arg parsing for starting in given mode
Diffstat (limited to 'src/Chelleport.hs')
-rw-r--r--src/Chelleport.hs7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/Chelleport.hs b/src/Chelleport.hs
index 0f5569e..02977c9 100644
--- a/src/Chelleport.hs
+++ b/src/Chelleport.hs
@@ -2,6 +2,7 @@ module Chelleport where
import Chelleport.AppShell (setupAppShell)
import qualified Chelleport.AppState as AppState
+import Chelleport.Args (Configuration)
import Chelleport.Context (initializeContext)
import Chelleport.Control (anyAlphabetic, anyDigit, checkKey, ctrl, eventToKeycode, hjkl, hjklDirection, key, pressed, released, shift)
import Chelleport.KeySequence (keycodeToInt, toKeyChar)
@@ -13,12 +14,12 @@ import Control.Monad.Reader (ReaderT (runReaderT))
import Data.Maybe (fromMaybe)
import qualified SDL
-run :: IO ()
-run = do
+run :: Configuration -> IO ()
+run config = do
ctx <- initializeContext
-- Cosplaying as elm
runAppWithCtx ctx $
- setupAppShell ctx AppState.initialState AppState.update eventHandler View.render
+ setupAppShell ctx (AppState.initialState config) AppState.update eventHandler View.render
where
runAppWithCtx :: (MonadIO m) => DrawContext -> AppM m x -> m x
runAppWithCtx ctx = (`runReaderT` ctx) . runAppM