aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--compiler/app/Main.hs35
-rw-r--r--compiler/package.yaml3
2 files changed, 32 insertions, 6 deletions
diff --git a/compiler/app/Main.hs b/compiler/app/Main.hs
index 2511998..be57c82 100644
--- a/compiler/app/Main.hs
+++ b/compiler/app/Main.hs
@@ -17,14 +17,41 @@
17-- along with this program. If not, see <https://www.gnu.org/licenses/>. 17-- along with this program. If not, see <https://www.gnu.org/licenses/>.
18 18
19{-# LANGUAGE 19{-# LANGUAGE
20 DuplicateRecordFields 20 RecordWildCards
21 , DeriveGeneric 21 , ApplicativeDo
22 , DeriveAnyClass
23#-} 22#-}
24 23
25module Main where 24module Main where
26 25
26import Options.Applicative
27import Data.Semigroup ((<>))
27import Compiler 28import Compiler
28 29
30data Args = Args
31 { inputDir :: String
32 , outputDir :: String }
33
34args :: Parser Args
35args = Args
36 <$> strOption
37 ( long "input"
38 <> short 'i'
39 <> metavar "INPUT DIR"
40 <> help "Gallery source directory" )
41 <*> strOption
42 ( long "output"
43 <> short 'o'
44 <> metavar "OUTPUT DIR"
45 <> help "Generated gallery output path, outside of the input directory" )
46
29main :: IO () 47main :: IO ()
30main = compileGallery "../../example" "../../out" 48main =
49 do
50 options <- execParser opts
51 compileGallery (inputDir options) (outputDir options)
52
53 where
54 opts = info (args <**> helper)
55 ( fullDesc
56 <> progDesc "Compile a picture gallery"
57 <> header "ldgallery - A static generator which turns a collection of tagged pictures into a searchable web gallery.")
diff --git a/compiler/package.yaml b/compiler/package.yaml
index 85740ab..e3c1eb6 100644
--- a/compiler/package.yaml
+++ b/compiler/package.yaml
@@ -21,8 +21,7 @@ dependencies:
21- directory 21- directory
22- aeson 22- aeson
23- yaml 23- yaml
24#- optparse-applicative 24- optparse-applicative
25#- cmdargs
26- JuicyPixels 25- JuicyPixels
27- JuicyPixels-extra 26- JuicyPixels-extra
28 27