summaryrefslogtreecommitdiff
path: root/diddohs.hs
diff options
context:
space:
mode:
authorHendrik Jaeger <henk@hnjs.ch>2013-10-09 21:36:58 +0200
committerHendrik Jaeger <henk@hnjs.ch>2013-10-09 21:36:58 +0200
commitd760c256d9847e64a86ff13a4a5210481606b224 (patch)
tree7149b090ea3cab4387f20d0432a273a8e92d87b3 /diddohs.hs
On branch master
Initial commit Changes to be committed: new file: diddohs.hs ADDED: first attempt
Diffstat (limited to 'diddohs.hs')
-rw-r--r--diddohs.hs36
1 files changed, 36 insertions, 0 deletions
diff --git a/diddohs.hs b/diddohs.hs
new file mode 100644
index 0000000..fdc1d0d
--- /dev/null
+++ b/diddohs.hs
@@ -0,0 +1,36 @@
+import System.Environment
+import System.IO
+import Options.Applicative
+import Data.Time
+
+data Args = Args
+ { entry :: String
+-- , time :: Time
+-- , verbose :: Bool
+-- , file :: String
+}
+
+runWithOptions :: Args -> IO ()
+runWithOptions opts =
+ putStrLn ( entry opts ++ " saved." )
+
+main :: IO ()
+main = execParser opts >>= runWithOptions
+ where
+ parser = Args <$> argument str (metavar "ENTRY")
+ opts = info parser mempty
+
+-- main = getArgs >>= parse
+
+-- parse [] = getLine >>= saveActivity "actlog.txt"
+-- parse ["add"] = getLine >>= saveActivity "actlog.txt"
+-- parse ["new"] = getLine >>= saveActivity "actlog.txt"
+-- parse ("add":entry) = saveActivity "actlog.txt" $ unwords entry
+-- parse ("new":entry) = saveActivity "actlog.txt" $ unwords entry
+-- parse ("-f":
+
+-- saveActivity file act = do
+-- zoneTime <- fmap show Data.Time.getZonedTime
+-- appendFile "actlog.txt" (zoneTime ++ "\t" ++ act ++ "\n")
+-- hPutStrLn stderr ("\"" ++ zoneTime ++ "\t" ++ act ++ "\"" ++ " saved.")
+