Add argument switch to enable RSS generation
This commit is contained in:
parent
36651ddc38
commit
00c9b882b5
1 changed files with 10 additions and 1 deletions
|
@ -6,7 +6,10 @@ module Arguments (
|
||||||
import Data.Monoid ((<>))
|
import Data.Monoid ((<>))
|
||||||
import Data.Version (showVersion)
|
import Data.Version (showVersion)
|
||||||
import Control.Applicative ((<|>), (<**>), optional)
|
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 Options.Applicative as Optparse (option)
|
||||||
import qualified Paths_hablo as Hablo (version)
|
import qualified Paths_hablo as Hablo (version)
|
||||||
import System.FilePath (dropTrailingPathSeparator, isValid)
|
import System.FilePath (dropTrailingPathSeparator, isValid)
|
||||||
|
@ -24,6 +27,7 @@ data Arguments = BlogConfig {
|
||||||
, previewArticlesCount :: Int
|
, previewArticlesCount :: Int
|
||||||
, previewLinesCount :: Int
|
, previewLinesCount :: Int
|
||||||
, remarkableConfig :: Maybe FilePath
|
, remarkableConfig :: Maybe FilePath
|
||||||
|
, rss :: Bool
|
||||||
, siteURL :: Maybe String
|
, siteURL :: Maybe String
|
||||||
, wording :: Maybe FilePath
|
, wording :: Maybe FilePath
|
||||||
}
|
}
|
||||||
|
@ -73,6 +77,11 @@ blogConfig = BlogConfig
|
||||||
)
|
)
|
||||||
<*> option filePath 'r' "remarkable-config" "FILE"
|
<*> option filePath 'r' "remarkable-config" "FILE"
|
||||||
"path to a file containing a custom RemarkableJS configuration"
|
"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 'u' "site-url" "URL" "URL where the blog is published"
|
||||||
<*> option filePath 'w' "wording" "FILE" "path to the file containing the wording to use"
|
<*> option filePath 'w' "wording" "FILE" "path to the file containing the wording to use"
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue