aboutsummaryrefslogtreecommitdiff
path: root/hsm-core/Hsm/Core/App.hs
blob: 12849d45146faa0e2830f87e20c9c95033a36c3a (plain)
1
2
3
4
5
6
7
8
9
module Hsm.Core.App
  ( runApp
  ) where

import Effectful (Eff, IOE, runEff)
import Options.Applicative (Parser, (<**>), execParser, fullDesc, helper, info, progDesc)

runApp :: Parser o -> String -> (o -> Eff '[ IOE] a) -> IO a
runApp parser desc app = execParser (info (parser <**> helper) $ fullDesc <> progDesc desc) >>= runEff . app