Streaming read

This commit is contained in:
2020-12-10 23:08:03 +02:00
parent d0521df8bb
commit 55ddbd55e2
5 changed files with 54 additions and 6 deletions

View File

@ -1,8 +1,22 @@
{-# LANGUAGE LambdaCase #-}
module Main where
import qualified MyLib (someFunc)
import Options.Applicative
import qualified Control.Addressbook.Streaming as Streaming
data CmdLine
= Stream
deriving Show
cmdline :: Parser CmdLine
cmdline = subparser (command "stream" (info (pure Stream) (progDesc "Record a stream of filenames")))
handler :: CmdLine -> IO ()
handler = \case
Stream -> Streaming.run
main :: IO ()
main = do
putStrLn "Hello, Haskell!"
MyLib.someFunc
main = execParser opts >>= handler
where
opts = info (cmdline <**> helper) (fullDesc <> progDesc "Email addressbook")