git.iko.soy/typeable/pandoc
on master help sign in
T.P.App.Opt: rename optReader, optWriter as optFrom, optTo.
ff1df24John MacFarlane
src/Text/Pandoc/App.hs+1−1
@@ -136,7 +136,7 @@ convertWithOpts opts = do
136 setOutputFile (optOutputFile opts)
136 setOutputFile (optOutputFile opts)
137
137
138 -- assign reader and writer based on options and filenames
138 -- assign reader and writer based on options and filenames
139− readerName <- case optReader opts of
139+ readerName <- case optFrom opts of
140 Just f -> return f
140 Just f -> return f
141 Nothing -> case formatFromFilePaths sources of
141 Nothing -> case formatFromFilePaths sources of
142 Just f' -> return f'
142 Just f' -> return f'
src/Text/Pandoc/App/CommandLineOptions.hs+2−2
@@ -131,14 +131,14 @@ options =
131
131
132 , Option "fr" ["from","read"]
132 , Option "fr" ["from","read"]
133 (ReqArg
133 (ReqArg
134− (\arg opt -> return opt { optReader =
134+ (\arg opt -> return opt { optFrom =
135 Just (map toLower arg) })
135 Just (map toLower arg) })
136 "FORMAT")
136 "FORMAT")
137 ""
137 ""
138
138
139 , Option "tw" ["to","write"]
139 , Option "tw" ["to","write"]
140 (ReqArg
140 (ReqArg
141− (\arg opt -> return opt { optWriter = Just arg })
141+ (\arg opt -> return opt { optTo = Just arg })
142 "FORMAT")
142 "FORMAT")
143 ""
143 ""
144
144
src/Text/Pandoc/App/Opt.hs+4−4
@@ -45,8 +45,8 @@ data Opt = Opt
45 { optTabStop :: Int -- ^ Number of spaces per tab
45 { optTabStop :: Int -- ^ Number of spaces per tab
46 , optPreserveTabs :: Bool -- ^ Preserve tabs instead of converting to spaces
46 , optPreserveTabs :: Bool -- ^ Preserve tabs instead of converting to spaces
47 , optStandalone :: Bool -- ^ Include header, footer
47 , optStandalone :: Bool -- ^ Include header, footer
48− , optReader :: Maybe String -- ^ Reader format
48+ , optFrom :: Maybe String -- ^ Reader format
49− , optWriter :: Maybe String -- ^ Writer format
49+ , optTo :: Maybe String -- ^ Writer format
50 , optTableOfContents :: Bool -- ^ Include table of contents
50 , optTableOfContents :: Bool -- ^ Include table of contents
51 , optShiftHeadingLevelBy :: Int -- ^ Shift heading level by
51 , optShiftHeadingLevelBy :: Int -- ^ Shift heading level by
52 , optTemplate :: Maybe FilePath -- ^ Custom template
52 , optTemplate :: Maybe FilePath -- ^ Custom template
@@ -119,8 +119,8 @@ defaultOpts = Opt
119 { optTabStop = 4
119 { optTabStop = 4
120 , optPreserveTabs = False
120 , optPreserveTabs = False
121 , optStandalone = False
121 , optStandalone = False
122− , optReader = Nothing
122+ , optFrom = Nothing
123− , optWriter = Nothing
123+ , optTo = Nothing
124 , optTableOfContents = False
124 , optTableOfContents = False
125 , optShiftHeadingLevelBy = 0
125 , optShiftHeadingLevelBy = 0
126 , optTemplate = Nothing
126 , optTemplate = Nothing
src/Text/Pandoc/App/OutputSettings.hs+2−2
@@ -68,8 +68,8 @@ optToOutputSettings opts = do
68 let pdfOutput = map toLower (takeExtension outputFile) == ".pdf"
68 let pdfOutput = map toLower (takeExtension outputFile) == ".pdf"
69 (writerName, maybePdfProg) <-
69 (writerName, maybePdfProg) <-
70 if pdfOutput
70 if pdfOutput
71− then liftIO $ pdfWriterAndProg (optWriter opts) (optPdfEngine opts)
71+ then liftIO $ pdfWriterAndProg (optTo opts) (optPdfEngine opts)
72− else case optWriter opts of
72+ else case optTo opts of
73 Nothing
73 Nothing
74 | outputFile == "-" -> return ("html", Nothing)
74 | outputFile == "-" -> return ("html", Nothing)
75 | otherwise ->
75 | otherwise ->