diff options
| author | John MacFarlane <[email protected]> | 2022-10-13 17:59:49 -0700 |
|---|---|---|
| committer | John MacFarlane <[email protected]> | 2022-10-13 17:59:49 -0700 |
| commit | f486fcde13306aeb818b6db830bc86c4372ace57 (patch) | |
| tree | 1f5a9e52d438f288343e0e8281a0a272475cb415 /src/Text/Pandoc/App/CommandLineOptions.hs | |
| parent | 14c7b5db20e8864f745cc95fb71c08befe49da0c (diff) | |
Rollback parameterize options on scripting engine.
Rolls back 0ab014ed1e5890e338792fab98aecc45cd889f99.
We don't need this because we aren't needing to print the Lua
version in options any more; we're handling `--version` now at
the pandoc-cli level.
Diffstat (limited to 'src/Text/Pandoc/App/CommandLineOptions.hs')
| -rw-r--r-- | src/Text/Pandoc/App/CommandLineOptions.hs | 14 |
1 files changed, 5 insertions, 9 deletions
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" ] |
