Add back basic UI

This commit is contained in:
Joscha 2018-09-18 19:41:12 +00:00
parent 9effbd1d1b
commit c72ca628f9
12 changed files with 616 additions and 62 deletions

View file

@ -1,42 +1,15 @@
module Main where
{-
import Control.Applicative
import Control.Monad
import qualified Brick as B
import qualified Options.Applicative as O
import qualified Brick as B
import TaskMachine.LTask
import TaskMachine.Options
import TaskMachine.UI
import TaskMachine.UI.Types
newtype Options = Options
{ oTodofile :: FilePath
} deriving (Show)
opts :: O.Parser Options
opts = pure Options
<*> todofile
where
todofile = O.strArgument
( O.help "The file containing all your tasks"
<> O.metavar "TODOFILE"
)
optsInfo :: O.ParserInfo Options
optsInfo = O.info (opts <**> O.helper) O.fullDesc
-- <> O.progDesc "program description"
-- <> O.header "help header"
import TaskMachine.UI.TaskList
main :: IO()
main = do
o <- O.execParser optsInfo
result <- loadLTasks (oTodofile o)
case result of
Left parseError -> putStrLn parseError
Right tasks -> void $ B.defaultMain (myApp defaultTheme) (startUIState tasks)
-}
main :: IO ()
main = putStrLn "Hello world again"
o <- parseOptions
state <- loadTasks (startUIState o)
void $ B.defaultMain myApp state