Skip to content

Commit

Permalink
Expose & document hakyllWithExitCodeAndArgs, Options, and Command
Browse files Browse the repository at this point in the history
  • Loading branch information
barrucadu authored and jaspervdj committed Jul 10, 2017
1 parent 83a95b3 commit a0a819a
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions lib/Hakyll/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ module Hakyll.Main
, hakyllWith
, hakyllWithArgs
, hakyllWithExitCode
, hakyllWithExitCodeAndArgs
, Options(..)
, Command(..)
) where


Expand Down Expand Up @@ -94,20 +97,32 @@ invokeCommands args conf check logger rules =

--------------------------------------------------------------------------------

-- | The parsed command-line options.
data Options = Options {verbosity :: Bool, optCommand :: Command}
deriving (Show)

-- | The command to run.
data Command
= Build
-- ^ Generate the site.
| Check {internal_links :: Bool}
-- ^ Validate the site output.
| Clean
-- ^ Clean up and remove cache.
| Deploy
-- ^ Upload/deploy your site.
| Preview {port :: Int}
-- ^ [DEPRECATED] Please use the watch command.
| Rebuild
-- ^ Clean and build again.
| Server {host :: String, port :: Int}
-- ^ Start a preview server.
| Watch {host :: String, port :: Int, no_server :: Bool }
-- ^ Autocompile on changes and start a preview server.
deriving (Show)

{-# DEPRECATED Preview "Use Watch instead." #-}

optionParser :: Config.Configuration -> OA.Parser Options
optionParser conf = Options <$> verboseParser <*> commandParser conf
where
Expand Down

0 comments on commit a0a819a

Please sign in to comment.