A static site generator written in Haskell
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

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