@@ -33,8 +33,8 @@ module Main where
3333import Text.Pandoc
3434import Text.Pandoc.PDF (makePDF)
3535import Text.Pandoc.Readers.LaTeX (handleIncludes)
36−import Text.Pandoc.Shared ( tabFilter, readDataFileUTF8, safeRead,
37− headerShift, normalize, err, warn )
36+import Text.Pandoc.Shared ( tabFilter, readDataFileUTF8, readDataFile,
37+ safeRead, headerShift, normalize, err, warn )
3838import Text.Pandoc.XML ( toEntities, fromEntities )
3939import Text.Pandoc.SelfContained ( makeSelfContained )
4040import Text.Pandoc.Process (pipeProcess)
@@ -58,6 +58,7 @@ import Data.Foldable (foldrM)
5858import Network.HTTP (simpleHTTP, mkRequest, getResponseBody, RequestMethod(..))
5959import Network.URI (parseURI, isURI, URI(..))
6060import qualified Data.ByteString.Lazy as B
61+import qualified Data.ByteString as BS
6162import Text.CSL.Reference (Reference(..))
6263import Data.Aeson (eitherDecode', encode)
6364
@@ -347,13 +348,13 @@ options =
347348 "FORMAT")
348349 "" -- "Print default template for FORMAT"
349350
350− , Option "" ["print-sample-lua-writer"]
351− (NoArg
352− (\_ -> do
353− sample <- readDataFileUTF8 Nothing "sample.lua"
354− UTF8.hPutStr stdout sample
355− exitWith ExitSuccess))
356− "" -- "Print sample lua custom writer"
351+ , Option "" ["print-default-data-file"]
352+ (ReqArg
353+ (\arg _ -> do
354+ readDataFile Nothing arg >>= BS.hPutStr stdout
355+ exitWith ExitSuccess)
356+ "FILE")
357+ "" -- "Print default data file"
357358
358359 , Option "" ["no-wrap"]
359360 (NoArg