aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2015-03-31 06:34:40 +0900
committerSean Whitton <spwhitton@spwhitton.name>2015-03-31 06:34:40 +0900
commitb55bf2acfafa913a4da36e90569577bbbccee4fc (patch)
tree3a68c07606a6c3d503571dc8f1fc700d7d11610a
parent9786f087cab574bc386b2792834e56a781cd8a06 (diff)
downloadsrem-b55bf2acfafa913a4da36e90569577bbbccee4fc.tar.gz
simple structure for main program
-rw-r--r--src/Main.hs20
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