From 9ea75c128c2f80bc3b75b1f1b9e718ce6df6dd36 Mon Sep 17 00:00:00 2001 From: Jasper Van der Jeugt Date: Mon, 31 Dec 2012 15:32:46 +0100 Subject: Allow checking internal links only --- src/Hakyll/Main.hs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src/Hakyll/Main.hs') diff --git a/src/Hakyll/Main.hs b/src/Hakyll/Main.hs index 86aae28..527548d 100644 --- a/src/Hakyll/Main.hs +++ b/src/Hakyll/Main.hs @@ -16,7 +16,8 @@ import System.IO.Unsafe (unsafePerformIO) -------------------------------------------------------------------------------- -import qualified Hakyll.Commands as Commands +import qualified Hakyll.Check as Check +import qualified Hakyll.Commands as Commands import qualified Hakyll.Core.Configuration as Config import qualified Hakyll.Core.Logger as Logger import Hakyll.Core.Rules @@ -36,9 +37,12 @@ hakyllWith conf rules = do args' <- cmdArgs hakyllArgs let verbosity' = if verbose args' then Logger.Debug else Logger.Message + check' = + if internal_links args' then Check.InternalLinks else Check.All + case args' of Build _ -> Commands.build conf verbosity' rules - Check _ -> Commands.check conf verbosity' + Check _ _ -> Commands.check conf verbosity' check' Clean _ -> Commands.clean conf Deploy _ -> Commands.deploy conf Help _ -> showHelp @@ -56,7 +60,7 @@ showHelp = print $ CA.helpText [] CA.HelpFormatOne $ cmdArgsMode hakyllArgs -------------------------------------------------------------------------------- data HakyllArgs = Build {verbose :: Bool} - | Check {verbose :: Bool} + | Check {verbose :: Bool, internal_links :: Bool} | Clean {verbose :: Bool} | Deploy {verbose :: Bool} | Help {verbose :: Bool} @@ -70,7 +74,8 @@ data HakyllArgs hakyllArgs :: HakyllArgs hakyllArgs = modes [ (Build $ verboseFlag def) &= help "Generate the site" - , (Check $ verboseFlag def) &= help "Validate the site output" + , (Check (verboseFlag def) (False &= help "Check internal links only")) &= + help "Validate the site output" , (Clean $ verboseFlag def) &= help "Clean up and remove cache" , (Deploy $ verboseFlag def) &= help "Upload/deploy your site" , (Help $ verboseFlag def) &= help "Show this message" &= auto -- cgit v1.2.3