addressbook/app/Main.hs
2020-12-10 23:08:03 +02:00

23 lines
515 B
Haskell

{-# LANGUAGE LambdaCase #-}
module Main where
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 = execParser opts >>= handler
where
opts = info (cmdline <**> helper) (fullDesc <> progDesc "Email addressbook")