@@ -34,7 +34,7 @@ hakyll = hakyllWith Config.defaultConfiguration
3434-- configuration
3535hakyllWith :: Config.Configuration -> Rules a -> IO ()
3636hakyllWith conf rules = do
37− args' <- cmdArgs hakyllArgs
37+ args' <- cmdArgs (hakyllArgs conf)
3838
3939 let verbosity' = if verbose args' then Logger.Debug else Logger.Message
4040 check' =
@@ -55,7 +55,7 @@ hakyllWith conf rules = do
5555--------------------------------------------------------------------------------
5656-- | Show usage information.
5757showHelp :: IO ()
58−showHelp = print $ CA.helpText [] CA.HelpFormatOne $ cmdArgsMode hakyllArgs
58+showHelp = print $ CA.helpText [] CA.HelpFormatOne $ cmdArgsMode (hakyllArgs Config.defaultConfiguration)
5959
6060
6161--------------------------------------------------------------------------------
@@ -73,22 +73,23 @@ data HakyllArgs
7373
7474
7575--------------------------------------------------------------------------------
76−hakyllArgs :: HakyllArgs
77−hakyllArgs = modes
76+hakyllArgs :: Config.Configuration -> HakyllArgs
77+hakyllArgs conf = modes
7878 [ (Build $ verboseFlag def) &= help "Generate the site"
7979 , (Check (verboseFlag def) (False &= help "Check internal links only")) &=
8080 help "Validate the site output"
8181 , (Clean $ verboseFlag def) &= help "Clean up and remove cache"
8282 , (Deploy $ verboseFlag def) &= help "Upload/deploy your site"
8383 , (Help $ verboseFlag def) &= help "Show this message" &= auto
84− , (Preview (verboseFlag def) (portFlag 8000)) &=
84+ , (Preview (verboseFlag def) (portFlag defaultPort)) &=
8585 help "[Deprecated] Please use the watch command"
8686 , (Rebuild $ verboseFlag def) &= help "Clean and build again"
87− , (Server (verboseFlag def) (portFlag 8000)) &=
87+ , (Server (verboseFlag def) (portFlag defaultPort)) &=
8888 help "Start a preview server"
89− , (Watch (verboseFlag def) (portFlag 8000) (noServerFlag False) &=
89+ , (Watch (verboseFlag def) (portFlag defaultPort) (noServerFlag False) &=
9090 help "Autocompile on changes and start a preview server. You can watch and recompile without running a server with --no-server.")
9191 ] &= help "Hakyll static site compiler" &= program progName
92+ where defaultPort = Config.previewPort conf
9293
9394
9495--------------------------------------------------------------------------------