buuka/app/Main.hs
2020-12-30 23:29:56 +02:00

24 lines
571 B
Haskell

module Main where
import Options.Applicative
import Control.Monad.Buuka
(BuukaM, runBuukaM)
import Data.Environment
import qualified Operations
commands :: Parser (BuukaM ())
commands = subparser
( command "insert" (info (insertOpts Operations.insert) (progDesc "Insert a new bookmark")))
where
insertOpts f =
f <$> strOption (long "url" <> short 'u' <> metavar "URL")
<*> optional (strOption (long "title"))
main :: IO ()
main = do
let env = Environment "."
execParser (info (commands <**> helper) fullDesc) >>= runBuukaM env