diff options
| author | Albert Krewinkel <[email protected]> | 2022-09-27 11:59:52 +0200 |
|---|---|---|
| committer | John MacFarlane <[email protected]> | 2022-09-27 08:42:27 -0700 |
| commit | 175b791529a960bf7df8bccb8876783076b3d321 (patch) | |
| tree | 17df31777977ce93e22960b8796c56bde3967e7e /pandoc-cli/src | |
| parent | a3fd6c674d233f949f070ff10c131f3713b78b4e (diff) | |
pandoc-cli: support "lua" and "serve" as commands
Pandoc behaves like `pandoc-lua` and `pandoc-server` if the first
argument is `lua` and `serve`, respectively.
Diffstat (limited to 'pandoc-cli/src')
| -rw-r--r-- | pandoc-cli/src/pandoc.hs | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/pandoc-cli/src/pandoc.hs b/pandoc-cli/src/pandoc.hs index ca39b316f..630352c2c 100644 --- a/pandoc-cli/src/pandoc.hs +++ b/pandoc-cli/src/pandoc.hs @@ -31,10 +31,14 @@ main = E.handle (handleError . Left) $ do rawArgs <- map UTF8.decodeArg <$> getArgs case prg of "pandoc-server.cgi" -> runCGI - "pandoc-server" -> runServer + "pandoc-server" -> runServer rawArgs "pandoc-lua" -> runLuaInterpreter prg rawArgs - _ -> parseOptionsFromArgs options defaultOpts prg rawArgs - >>= convertWithOpts + _ -> + case rawArgs of + "lua" : args -> runLuaInterpreter "pandoc lua" args + "serve" : args -> runServer args + _ -> parseOptionsFromArgs options defaultOpts prg rawArgs + >>= convertWithOpts -- | Runs pandoc as a Lua interpreter that is (mostly) compatible with -- the default @lua@ program shipping with Lua. |
