From 1e57d76eadb2192be2b3d9343d4ddfeccc996bcb Mon Sep 17 00:00:00 2001 From: pacien Date: Fri, 27 Dec 2019 13:38:47 +0100 Subject: compiler: exclude output dir from input --- compiler/app/Main.hs | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'compiler/app') diff --git a/compiler/app/Main.hs b/compiler/app/Main.hs index be57c82..d9b019a 100644 --- a/compiler/app/Main.hs +++ b/compiler/app/Main.hs @@ -29,29 +29,38 @@ import Compiler data Args = Args { inputDir :: String - , outputDir :: String } + , outputDir :: String + , rebuild :: Bool } args :: Parser Args args = Args <$> strOption ( long "input" <> short 'i' - <> metavar "INPUT DIR" + <> metavar "SOURCE DIR" + <> value "./" + <> showDefault <> help "Gallery source directory" ) <*> strOption ( long "output" <> short 'o' <> metavar "OUTPUT DIR" - <> help "Generated gallery output path, outside of the input directory" ) + <> value "./out" + <> showDefault + <> help "Generated gallery output path" ) + <*> switch + ( long "rebuild" + <> short 'r' + <> help "Invalidate cache and recompile everything" ) main :: IO () main = do options <- execParser opts - compileGallery (inputDir options) (outputDir options) + compileGallery (inputDir options) (outputDir options) (rebuild options) where opts = info (args <**> helper) ( fullDesc - <> progDesc "Compile a picture gallery" - <> header "ldgallery - A static generator which turns a collection of tagged pictures into a searchable web gallery.") + <> progDesc "Compile a gallery" + <> header "ldgallery - a static gallery generator with tags" ) -- cgit v1.2.3