diff options
Diffstat (limited to 'hsm-core/Hsm/Core/App.hs')
-rw-r--r-- | hsm-core/Hsm/Core/App.hs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/hsm-core/Hsm/Core/App.hs b/hsm-core/Hsm/Core/App.hs new file mode 100644 index 0000000..12849d4 --- /dev/null +++ b/hsm-core/Hsm/Core/App.hs @@ -0,0 +1,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 |