Insertion support

This commit is contained in:
2020-12-30 23:29:56 +02:00
parent 98341a8c9f
commit 4806e06444
10 changed files with 202 additions and 9 deletions

View File

@ -1,8 +1,23 @@
module Main where
import qualified MyLib (someFunc)
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
putStrLn "Hello, Haskell!"
MyLib.someFunc
let env = Environment "."
execParser (info (commands <**> helper) fullDesc) >>= runBuukaM env