summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Walker <mike@barrucadu.co.uk>2017-07-10 11:47:03 +0100
committerJasper Van der Jeugt <jaspervdj@gmail.com>2017-07-10 12:47:03 +0200
commita0a819aa61f5fad90d5bb48f1e14751b7848a844 (patch)
treef46a049c66de00c6c17e56913791bf8dd48e8c47
parent83a95b3eb41745d3a6f7cb6fcb7ba6c1e1657a84 (diff)
downloadhakyll-a0a819aa61f5fad90d5bb48f1e14751b7848a844.tar.gz
Expose & document hakyllWithExitCodeAndArgs, Options, and Command
-rw-r--r--lib/Hakyll/Main.hs15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/Hakyll/Main.hs b/lib/Hakyll/Main.hs
index 6332da1..5abf3a7 100644
--- a/lib/Hakyll/Main.hs
+++ b/lib/Hakyll/Main.hs
@@ -7,6 +7,9 @@ module Hakyll.Main
, hakyllWith
, hakyllWithArgs
, hakyllWithExitCode
+ , hakyllWithExitCodeAndArgs
+ , Options(..)
+ , Command(..)
) where
@@ -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