From a0a819aa61f5fad90d5bb48f1e14751b7848a844 Mon Sep 17 00:00:00 2001 From: Michael Walker Date: Mon, 10 Jul 2017 11:47:03 +0100 Subject: Expose & document hakyllWithExitCodeAndArgs, Options, and Command --- lib/Hakyll/Main.hs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'lib/Hakyll') 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 -- cgit v1.2.3