be nice and use metavars in --help

This commit is contained in:
Mirek Kratochvil 2025-01-29 20:48:41 +01:00
parent eeb49be54a
commit 540055fb74

View file

@ -88,6 +88,7 @@ siteOptions' = do
strOption
$ long "output"
<> short 'd'
<> metavar "OUTDIR"
<> help "Directory to render the site to"
<> value "_site"
<> showDefault
@ -95,28 +96,33 @@ siteOptions' = do
Just
<$> (strOption
$ long "search-data-output"
<> metavar "JSON"
<> help "Output JSON with searchable page data to this file")
<|> pure Nothing
_assetDirs <-
many . strOption
$ long "assets"
<> short 'a'
<> metavar "DIR"
<> help
"Assets directory to be copied verbatim (possibly multiple paths)"
_sourceDirs <-
many . strOption
$ long "source-directory"
<> short 's'
<> metavar "DIR"
<> help
"Path to the directory with source data (possibly multiple paths)"
_notSourceDirs <-
many . strOption
$ long "exclude-source-directory"
<> metavar "EXCLUDE"
<> help
"Names of subdirectories of the sources that should never be used for sourcing pages (possibly multiple directory names)"
_tagMetaFile <-
strOption
$ long "tag-metadata-file"
<> metavar "FILENAME"
<> help "Name of files with tag metadata"
<> value "tag-metadata.yml"
<> showDefault
@ -124,11 +130,13 @@ siteOptions' = do
many . strOption
$ long "template-directory"
<> short 't'
<> metavar "DIR"
<> help
"Path to the directory with templates (possibly multiple paths)"
_defaultTemplate <-
strOption
$ long "default-template"
<> metavar "FILENAME"
<> help
"Default template to use for stuff (as found in templates directory)"
<> value "default.html"
@ -136,24 +144,28 @@ siteOptions' = do
_redirectTemplate <-
strOption
$ long "redirect-template"
<> metavar "FILENAME"
<> help "Template for making redirect pages"
<> value "redirect.html"
<> showDefault
_tagTemplate <-
strOption
$ long "tag-template"
<> metavar "FILENAME"
<> help "Template for making category view pages"
<> value "tag.html"
<> showDefault
_listTemplate <-
strOption
$ long "list-template"
<> metavar "FILENAME"
<> help "Template for making tag-listing pages"
<> value "list.html"
<> showDefault
_metadataSuffix <-
strOption
$ long "metadata-suffix"
<> metavar "SUFFIX"
<> help
"Suffix for YAML files with base metadata for each markdown page. Metadata from files override the extra metadata specified on commandline, but are overridden by metadata specified directly in the markdown header of the pages."
<> value ".metadata.yml"
@ -164,11 +176,13 @@ siteOptions' = do
[ fmap MetaSpecInline . strOption
$ long "extra-metadata"
<> short 'e'
<> metavar "YAML"
<> help
"Extra metadata to add to pages rendering in YAML format. May be specified multiple times."
, fmap MetaSpecFile . strOption
$ long "extra-metadata-file"
<> short 'E'
<> metavar "FILE"
<> help
"Extra metadata to add to pages rendering, loaded from a YAML file. May be specified multiple times."
]
@ -176,13 +190,15 @@ siteOptions' = do
strOption
$ long "url-base"
<> short 'u'
<> metavar "URL"
<> help "Base absolute URL"
<> value "/"
<> showDefault
_indexFile <-
strOption
$ long "index-filename"
<> help "Base absolute URL"
<> metavar "FILENAME"
<> help "Directory index to use for page output."
<> value "index.html"
<> showDefault
_appendUrlIndex <-