summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pandoc-cli/src/pandoc.hs3
-rw-r--r--src/Text/Pandoc/App/CommandLineOptions.hs14
-rw-r--r--test/test-pandoc.hs2
3 files changed, 7 insertions, 12 deletions
diff --git a/pandoc-cli/src/pandoc.hs b/pandoc-cli/src/pandoc.hs
index 244727719..274b1c567 100644
--- a/pandoc-cli/src/pandoc.hs
+++ b/pandoc-cli/src/pandoc.hs
@@ -62,8 +62,7 @@ main = E.handle (handleError . Left) $ do
"server": args -> runServer args
_ -> do
engine <- getEngine
- let cliOpts = options engine
- opts <- parseOptionsFromArgs cliOpts defaultOpts prg rawArgs
+ opts <- parseOptionsFromArgs options defaultOpts prg rawArgs
convertWithOpts engine opts
copyrightMessage :: String
diff --git a/src/Text/Pandoc/App/CommandLineOptions.hs b/src/Text/Pandoc/App/CommandLineOptions.hs
index a9afec7f6..5142ab3b2 100644
--- a/src/Text/Pandoc/App/CommandLineOptions.hs
+++ b/src/Text/Pandoc/App/CommandLineOptions.hs
@@ -52,7 +52,6 @@ import Text.Pandoc.App.Opt (Opt (..), LineEnding (..), IpynbOutput (..),
fullDefaultsPath)
import Text.Pandoc.Filter (Filter (..))
import Text.Pandoc.Highlighting (highlightingStyles, lookupHighlightingStyle)
-import Text.Pandoc.Scripting (ScriptingEngine (engineName))
import Text.Pandoc.Shared (ordNub, elemText, safeStrRead, defaultUserDataDir)
import Text.Printf
import qualified Control.Exception as E
@@ -122,8 +121,8 @@ pdfEngines = ordNub $ map snd engines
-- | A list of functions, each transforming the options data structure
-- in response to a command-line option.
-options :: ScriptingEngine -> [OptDescr (Opt -> IO Opt)]
-options scriptingEngine =
+options :: [OptDescr (Opt -> IO Opt)]
+options =
[ Option "fr" ["from","read"]
(ReqArg
(\arg opt -> return opt { optFrom =
@@ -805,8 +804,7 @@ options scriptingEngine =
let optnames (Option shorts longs _ _) =
map (\c -> ['-',c]) shorts ++
map ("--" ++) longs
- let allopts = unwords (concatMap optnames
- (options scriptingEngine))
+ let allopts = unwords (concatMap optnames options)
UTF8.hPutStrLn stdout $ T.pack $ printf tpl allopts
(T.unpack $ T.unwords readersNames)
(T.unpack $ T.unwords writersNames)
@@ -941,8 +939,7 @@ options scriptingEngine =
UTF8.hPutStrLn stdout
$ T.pack
$ prg ++ " " ++ T.unpack pandocVersionText ++
- compileInfo ++ "\nScripting engine: " ++
- T.unpack (engineName scriptingEngine) ++
+ compileInfo ++
"\nUser data directory: " ++ defaultDatadir ++
('\n':copyrightMessage)
exitSuccess ))
@@ -952,8 +949,7 @@ options scriptingEngine =
(NoArg
(\_ -> do
prg <- getProgName
- UTF8.hPutStr stdout (T.pack $ usageMessage prg
- (options scriptingEngine))
+ UTF8.hPutStr stdout (T.pack $ usageMessage prg options)
exitSuccess ))
"" -- "Show help"
]
diff --git a/test/test-pandoc.hs b/test/test-pandoc.hs
index 73841d29b..80b5e45ed 100644
--- a/test/test-pandoc.hs
+++ b/test/test-pandoc.hs
@@ -107,7 +107,7 @@ main = do
case args of
"--emulate":args' -> -- emulate pandoc executable
E.catch
- (parseOptionsFromArgs (options noEngine) defaultOpts "pandoc" args'
+ (parseOptionsFromArgs options defaultOpts "pandoc" args'
>>= convertWithOpts noEngine)
(handleError . Left)
_ -> inDirectory "test" $ do