A static site generator written in Haskell
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

CLI.hs 423B

1234567891011121314151617181920212223
  1. module CLI
  2. ( argParser
  3. , Config(..)
  4. )
  5. where
  6. import System.Console.ArgParser
  7. data Config =
  8. Build FilePath Bool
  9. | New String
  10. deriving (Show)
  11. argParser :: IO (CmdLnInterface Config)
  12. argParser = mkSubParser
  13. [ ( "build"
  14. , mkDefaultApp
  15. (Build `parsedBy` optPos "." "directory" `andBy` boolFlag "drafts")
  16. "build"
  17. )
  18. , ("new", mkDefaultApp (New `parsedBy` reqPos "name") "new")
  19. ]