Include Lua version in --version
output. (#7997)
This commit is contained in:
parent
e4f4be6c80
commit
40dd8fd129
1 changed files with 7 additions and 1 deletions
|
@ -4,6 +4,7 @@
|
|||
{-# LANGUAGE TupleSections #-}
|
||||
{-# LANGUAGE OverloadedStrings #-}
|
||||
{-# LANGUAGE FlexibleContexts #-}
|
||||
{-# LANGUAGE TypeApplications #-}
|
||||
{- |
|
||||
Module : Text.Pandoc.App.CommandLineOptions
|
||||
Copyright : Copyright (C) 2006-2022 John MacFarlane
|
||||
|
@ -37,6 +38,7 @@ import Data.List (isPrefixOf)
|
|||
#endif
|
||||
import Data.Maybe (fromMaybe, isJust)
|
||||
import Data.Text (Text)
|
||||
import HsLua (Exception, getglobal, openlibs, peek, run, top)
|
||||
import Safe (tailDef)
|
||||
import Skylighting (Style, Syntax (..), defaultSyntaxMap, parseTheme)
|
||||
import System.Console.GetOpt
|
||||
|
@ -946,10 +948,14 @@ options =
|
|||
(\_ -> do
|
||||
prg <- getProgName
|
||||
defaultDatadir <- defaultUserDataDir
|
||||
luaVersion <- HsLua.run @HsLua.Exception $ do
|
||||
openlibs
|
||||
getglobal "_VERSION"
|
||||
peek top
|
||||
UTF8.hPutStrLn stdout
|
||||
$ T.pack
|
||||
$ prg ++ " " ++ T.unpack pandocVersion ++
|
||||
compileInfo ++
|
||||
compileInfo ++ "\nScripting engine: " ++ luaVersion ++
|
||||
"\nUser data directory: " ++ defaultDatadir ++
|
||||
('\n':copyrightMessage)
|
||||
exitSuccess ))
|
||||
|
|
Loading…
Add table
Reference in a new issue