add depend-gallery options

This commit is contained in:
Rhiannon Morris 2020-07-16 11:48:37 +02:00
parent ae5dc6b006
commit adfc8b9a82

View file

@ -29,6 +29,15 @@ data ModeOptions =
buildDir :: FilePath,
dataDir :: FilePath
}
| DependGallery {
prefix :: FilePath,
files :: [FilePath],
nsfw :: Bool,
who :: Who,
output :: Maybe FilePath,
buildDir :: FilePath,
dataDir :: FilePath
}
deriving Show
@ -39,7 +48,7 @@ optionsParser = globalOpts `info` mainInfo where
short 'v' <> long "verbose" <>
help "print extra stuff to stderr"
subcommands = hsubparser $
single <> gallery <> dependSingle
single <> gallery <> dependSingle <> dependGallery
single = command "single" $ singleOpts `info` singleInfo
singleOpts = SinglePage <$> file <*> nsfwS <*> output
@ -81,6 +90,19 @@ optionsParser = globalOpts `info` mainInfo where
help "data directory (default: data)"
dsInfo = progDesc "generate makefile dependencies for a single page"
dependGallery = command "depend-gallery" $ dgOpts `info` dgInfo
dgOpts =
DependGallery <$> prefixArg <*> files <*> nsfwG <*> who
<*> output <*> buildDir <*> dataDir
prefixArg = strArgument $
metavar "PREFIX" <> help "target directory"
who = option (maybeReader readWho) $
short 'w' <> long "who" <>
metavar "mine|not-mine|all" <>
value All <>
help "select by artist"
dgInfo = progDesc "generate makefile dependencies for a gallery"
mainInfo = progDesc "static gallery site generator" <> fullDesc