on master help sign in
Expose & document hakyllWithExitCodeAndArgs, Options, and Command
commita0a819aa61f5fad90d5bb48f1e14751b7848a844 authorMichael Walker <mike@barrucadu.co.uk> dateMon 10 Jul 2017, 11:47 (9 years ago) parent83a95b3
1 file changed+15
lib/Hakyll/Main.hs+15
lib/Hakyll/Main.hs+15
@@ -7,6 +7,9 @@ module Hakyll.Main
77 , hakyllWith
88 , hakyllWithArgs
99 , hakyllWithExitCode
10+ , hakyllWithExitCodeAndArgs
11+ , Options(..)
12+ , Command(..)
1013 ) where
1114
1215
@@ -94,20 +97,32 @@ invokeCommands args conf check logger rules =
9497
9598--------------------------------------------------------------------------------
9699
100+-- | The parsed command-line options.
97101data Options = Options {verbosity :: Bool, optCommand :: Command}
98102 deriving (Show)
99103
104+-- | The command to run.
100105data Command
101106 = Build
107+ -- ^ Generate the site.
102108 | Check {internal_links :: Bool}
109+ -- ^ Validate the site output.
103110 | Clean
111+ -- ^ Clean up and remove cache.
104112 | Deploy
113+ -- ^ Upload/deploy your site.
105114 | Preview {port :: Int}
115+ -- ^ [DEPRECATED] Please use the watch command.
106116 | Rebuild
117+ -- ^ Clean and build again.
107118 | Server {host :: String, port :: Int}
119+ -- ^ Start a preview server.
108120 | Watch {host :: String, port :: Int, no_server :: Bool }
121+ -- ^ Autocompile on changes and start a preview server.
109122 deriving (Show)
110123
124+{-# DEPRECATED Preview "Use Watch instead." #-}
125+
111126optionParser :: Config.Configuration -> OA.Parser Options
112127optionParser conf = Options <$> verboseParser <*> commandParser conf
113128 where