Monadoro-0.3.1.0: app/Main.hs
module Main where
import System.Environment (getArgs)
import CLI (containsEither,
filterParams,
printVersion,
runPomodoros,
runSession,
showManual,
showUsage)
main :: IO ()
main = getArgs >>= parseArgs
parseArgs :: [String] -> IO ()
parseArgs xs
| xs `containsEither` ["--help", "-h"] = showUsage
| xs `containsEither` ["--version", "-v"] = printVersion
| xs `containsEither` ["--session", "-s"] = runSession xs
| xs `containsEither` ["--man", "-m"] = showManual
| otherwise = runPomodoros xs