Insertion support
This commit is contained in:
21
app/Main.hs
21
app/Main.hs
@ -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
|
||||
|
Reference in New Issue
Block a user