A static site generator written in Haskell
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

CLI.hs 574B

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. ]