diff options
author | Jasper Van der Jeugt <m@jaspervdj.be> | 2012-12-31 15:32:46 +0100 |
---|---|---|
committer | Jasper Van der Jeugt <m@jaspervdj.be> | 2012-12-31 15:32:46 +0100 |
commit | 9ea75c128c2f80bc3b75b1f1b9e718ce6df6dd36 (patch) | |
tree | f80e879a048d8f3f0969c9822f9a1a080905c3fe /src/Hakyll/Main.hs | |
parent | 24273d034850b1312c551f6ace7f0b549728cbc9 (diff) | |
download | hakyll-9ea75c128c2f80bc3b75b1f1b9e718ce6df6dd36.tar.gz |
Allow checking internal links only
Diffstat (limited to 'src/Hakyll/Main.hs')
-rw-r--r-- | src/Hakyll/Main.hs | 13 |
1 files changed, 9 insertions, 4 deletions
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 |