diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2015-03-31 06:34:40 +0900 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2015-03-31 06:34:40 +0900 |
commit | b55bf2acfafa913a4da36e90569577bbbccee4fc (patch) | |
tree | 3a68c07606a6c3d503571dc8f1fc700d7d11610a | |
parent | 9786f087cab574bc386b2792834e56a781cd8a06 (diff) | |
download | srem-b55bf2acfafa913a4da36e90569577bbbccee4fc.tar.gz |
simple structure for main program
-rw-r--r-- | src/Main.hs | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/Main.hs b/src/Main.hs index ae51aef..7e55e01 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -22,7 +22,25 @@ -} import Control.Applicative ((<$>), (<*>)) +import System.Environment (getArgs) import Types.Reminder import Utility.EventCache -main = undefined +doCron :: IO () +doCron = undefined + +cmdLineReminder :: [String] -> Maybe Reminder +cmdLineReminder args = undefined + +appendUserReminder :: Reminder -> IO () +appendUserReminder r = undefined + +main = do + args <- getArgs + if length args == 1 && head args == "--cron" + then doCron + else if length args == 1 && head args == "--emacs" + then refreshEmacsEventCache + else maybe + (error "srem: invalid input") + appendUserReminder $ cmdLineReminder args |