From 00c9b882b5e99df0419c18dc6e32a02e884ed6e1 Mon Sep 17 00:00:00 2001 From: Tissevert Date: Sun, 22 Mar 2020 23:16:00 +0100 Subject: [PATCH] Add argument switch to enable RSS generation --- src/Arguments.hs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/Arguments.hs b/src/Arguments.hs index f7b6a4e..4733555 100644 --- a/src/Arguments.hs +++ b/src/Arguments.hs @@ -6,7 +6,10 @@ module Arguments ( import Data.Monoid ((<>)) import Data.Version (showVersion) import Control.Applicative ((<|>), (<**>), optional) -import Options.Applicative (Parser, ReadM, argument, auto, eitherReader, execParser, flag', fullDesc, header, help, helper, info, long, metavar, short, str, value) +import Options.Applicative ( + Parser, ReadM, argument, auto, eitherReader, execParser, flag', fullDesc + , header, help, helper, info, long, metavar, short, str, switch, value + ) import qualified Options.Applicative as Optparse (option) import qualified Paths_hablo as Hablo (version) import System.FilePath (dropTrailingPathSeparator, isValid) @@ -24,6 +27,7 @@ data Arguments = BlogConfig { , previewArticlesCount :: Int , previewLinesCount :: Int , remarkableConfig :: Maybe FilePath + , rss :: Bool , siteURL :: Maybe String , wording :: Maybe FilePath } @@ -73,6 +77,11 @@ blogConfig = BlogConfig ) <*> option filePath 'r' "remarkable-config" "FILE" "path to a file containing a custom RemarkableJS configuration" + <*> switch ( + short 'R' + <> long "rss" + <> help "enable RSS feeds generation" + ) <*> option filePath 'u' "site-url" "URL" "URL where the blog is published" <*> option filePath 'w' "wording" "FILE" "path to the file containing the wording to use"