addressbook/app/Main.hs

23 lines
515 B
Haskell
Raw Normal View History

2020-12-10 23:08:03 +02:00
{-# LANGUAGE LambdaCase #-}
2020-12-10 19:47:11 +02:00
module Main where
2020-12-10 23:08:03 +02:00
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
2020-12-10 19:47:11 +02:00
main :: IO ()
2020-12-10 23:08:03 +02:00
main = execParser opts >>= handler
where
opts = info (cmdline <**> helper) (fullDesc <> progDesc "Email addressbook")