Command line options: use normalizePath in more places.

See #5127.  It is now used everywhere a file argument can be used.

Closes #5127.
This commit is contained in:
John MacFarlane 2020-09-19 22:32:31 -07:00
parent ba9bedef23
commit 26ed7fb4f9

View file

@ -283,21 +283,24 @@ options =
, Option "H" ["include-in-header"]
(ReqArg
(\arg opt -> return opt{ optIncludeInHeader =
optIncludeInHeader opt ++ [arg] })
optIncludeInHeader opt ++
[normalizePath arg] })
"FILE")
"" -- "File to include at end of header (implies -s)"
, Option "B" ["include-before-body"]
(ReqArg
(\arg opt -> return opt{ optIncludeBeforeBody =
optIncludeBeforeBody opt ++ [arg] })
optIncludeBeforeBody opt ++
[normalizePath arg] })
"FILE")
"" -- "File to include before document body"
, Option "A" ["include-after-body"]
(ReqArg
(\arg opt -> return opt{ optIncludeAfterBody =
optIncludeAfterBody opt ++ [arg] })
optIncludeAfterBody opt ++
[normalizePath arg] })
"FILE")
"" -- "File to include after document body"
@ -309,7 +312,8 @@ options =
, Option "" ["highlight-style"]
(ReqArg
(\arg opt ->
return opt{ optHighlightStyle = Just $ T.pack arg })
return opt{ optHighlightStyle = Just $
T.pack $ normalizePath arg })
"STYLE|FILE")
"" -- "Style for highlighted code"
@ -397,7 +401,7 @@ options =
, Option "" ["reference-doc"]
(ReqArg
(\arg opt ->
return opt { optReferenceDoc = Just arg })
return opt { optReferenceDoc = Just $ normalizePath arg })
"FILE")
"" -- "Path of custom reference doc"
@ -422,7 +426,8 @@ options =
, Option "" ["abbreviations"]
(ReqArg
(\arg opt -> return opt { optAbbreviations = Just arg })
(\arg opt -> return opt { optAbbreviations =
Just $ normalizePath arg })
"FILE")
"" -- "Specify file for custom abbreviations"
@ -607,21 +612,24 @@ options =
(ReqArg
(\arg opt ->
return opt { optVariables =
setVariable "epub-cover-image" (T.pack arg) $
setVariable "epub-cover-image"
(T.pack $ normalizePath arg) $
optVariables opt })
"FILE")
"" -- "Path of epub cover image"
, Option "" ["epub-metadata"]
(ReqArg
(\arg opt -> return opt { optEpubMetadata = Just arg })
(\arg opt -> return opt { optEpubMetadata = Just $
normalizePath arg })
"FILE")
"" -- "Path of epub metadata file"
, Option "" ["epub-embed-font"]
(ReqArg
(\arg opt ->
return opt{ optEpubFonts = arg : optEpubFonts opt })
return opt{ optEpubFonts = normalizePath arg :
optEpubFonts opt })
"FILE")
"" -- "Directory of fonts to embed"
@ -651,7 +659,8 @@ options =
, Option "" ["bibliography"]
(ReqArg
(\arg opt -> return opt{ optMetadata =
addMeta "bibliography" arg $
addMeta "bibliography"
(normalizePath arg) $
optMetadata opt })
"FILE")
""
@ -660,7 +669,8 @@ options =
(ReqArg
(\arg opt ->
return opt{ optMetadata =
addMeta "csl" arg $ optMetadata opt })
addMeta "csl" (normalizePath arg) $
optMetadata opt })
"FILE")
""
@ -668,8 +678,8 @@ options =
(ReqArg
(\arg opt ->
return opt{ optMetadata =
addMeta "citation-abbreviations" arg $
optMetadata opt })
addMeta "citation-abbreviations"
(normalizePath arg) $ optMetadata opt })
"FILE")
""
@ -752,7 +762,8 @@ options =
, Option "" ["log"]
(ReqArg
(\arg opt -> return opt{ optLogFile = Just arg })
(\arg opt -> return opt{ optLogFile = Just $
normalizePath arg })
"FILE")
"" -- "Log messages in JSON format to this file."