Advertisement
Guest User

Untitled

a guest
Aug 9th, 2021
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. {-# LANGUAGE NoImplicitPrelude #-}
  2. {-# LANGUAGE TemplateHaskell #-}
  3. module Main (main) where
  4.  
  5. import Import
  6. import Run
  7. import RIO.Process
  8. import Options.Applicative.Simple
  9. import qualified Paths_diamond_haskell
  10.  
  11. main :: IO ()
  12. main = do
  13. (options, ()) <- simpleOptions
  14. $(simpleVersion Paths_diamond_haskell.version)
  15. "Header for command line arguments"
  16. "Program description, also for command line arguments"
  17. (Options
  18. <$> switch ( long "input"
  19. <> short 'i'
  20. <> help "The letter that should be at the center."
  21. )
  22. )
  23. empty
  24. lo <- logOptionsHandle stderr (optionsVerbose options)
  25. pc <- mkDefaultProcessContext
  26. withLogFunc lo $ \lf ->
  27. let app = App
  28. { appLogFunc = lf
  29. , appProcessContext = pc
  30. , appOptions = options
  31. }
  32. in runRIO app run
  33.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement