diff options
author | John MacFarlane <jgm@berkeley.edu> | 2013-08-13 18:25:20 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2013-08-13 18:29:57 -0700 |
commit | bd73d73a28acc2863bd52bdc6f0f9d850fa34d84 (patch) | |
tree | 3f3740128beaec6e85dccc8bd62a81df8d5414c5 /pandoc.hs | |
parent | 3ebdc5b5f0f5bc88f727a36268d55921672899c0 (diff) |
Removed `--print-sample-lua-writer`, added `--print-default-data-file`.
Closes #943.
Diffstat (limited to 'pandoc.hs')
-rw-r--r-- | pandoc.hs | 19 |
1 files changed, 10 insertions, 9 deletions
@@ -33,8 +33,8 @@ module Main where import Text.Pandoc import Text.Pandoc.PDF (makePDF) import Text.Pandoc.Readers.LaTeX (handleIncludes) -import Text.Pandoc.Shared ( tabFilter, readDataFileUTF8, safeRead, - headerShift, normalize, err, warn ) +import Text.Pandoc.Shared ( tabFilter, readDataFileUTF8, readDataFile, + safeRead, headerShift, normalize, err, warn ) import Text.Pandoc.XML ( toEntities, fromEntities ) import Text.Pandoc.SelfContained ( makeSelfContained ) import Text.Pandoc.Process (pipeProcess) @@ -58,6 +58,7 @@ import Data.Foldable (foldrM) import Network.HTTP (simpleHTTP, mkRequest, getResponseBody, RequestMethod(..)) import Network.URI (parseURI, isURI, URI(..)) import qualified Data.ByteString.Lazy as B +import qualified Data.ByteString as BS import Text.CSL.Reference (Reference(..)) import Data.Aeson (eitherDecode', encode) @@ -347,13 +348,13 @@ options = "FORMAT") "" -- "Print default template for FORMAT" - , Option "" ["print-sample-lua-writer"] - (NoArg - (\_ -> do - sample <- readDataFileUTF8 Nothing "sample.lua" - UTF8.hPutStr stdout sample - exitWith ExitSuccess)) - "" -- "Print sample lua custom writer" + , Option "" ["print-default-data-file"] + (ReqArg + (\arg _ -> do + readDataFile Nothing arg >>= BS.hPutStr stdout + exitWith ExitSuccess) + "FILE") + "" -- "Print default data file" , Option "" ["no-wrap"] (NoArg |