{-# LANGUAGE CPP #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE PatternSynonyms #-}
module HsLua.CLI
(
runStandalone
, Settings (..)
, EnvBehavior (..)
) where
import Control.Monad (unless, void, when, zipWithM_)
import Data.Bifunctor (first)
import Data.ByteString (ByteString)
import Data.Maybe (listToMaybe)
import Data.Text (Text)
import Foreign.C.String (withCString)
import Lua (pattern LUA_COPYRIGHT)
import HsLua.Core (LuaE, LuaError)
import HsLua.REPL (Config (..), defaultConfig, repl, setup)
import System.Console.GetOpt
import System.Environment (lookupEnv)
import qualified Data.Text as T
import qualified Data.Text.IO as T
import qualified Lua.Constants as Lua
import qualified Lua.Primary as Lua
import qualified HsLua.Core as Lua
import qualified HsLua.Core.Utf8 as UTF8
import qualified HsLua.Marshalling as Lua
#if !MIN_VERSION_base(4,20,0)
import Data.Foldable (foldl')
#endif
#ifndef _WINDOWS
import System.Posix.IO (stdOutput)
import System.Posix.Terminal (queryTerminal)
#endif
istty :: IO Bool
#ifdef _WINDOWS
istty = pure True
#else
istty :: IO Bool
istty = Fd -> IO Bool
queryTerminal Fd
stdOutput
#endif
data Settings e = Settings
{ forall e. Settings e -> Text
settingsVersionInfo :: Text
, forall e. Settings e -> EnvBehavior -> LuaE e () -> IO ()
settingsRunner :: EnvBehavior -> LuaE e () -> IO ()
, forall e. Settings e -> Maybe [Char]
settingsHistory :: Maybe FilePath
}
data EnvBehavior = IgnoreEnvVars | ConsultEnvVars
deriving (EnvBehavior -> EnvBehavior -> Bool
(EnvBehavior -> EnvBehavior -> Bool)
-> (EnvBehavior -> EnvBehavior -> Bool) -> Eq EnvBehavior
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: EnvBehavior -> EnvBehavior -> Bool
== :: EnvBehavior -> EnvBehavior -> Bool
$c/= :: EnvBehavior -> EnvBehavior -> Bool
/= :: EnvBehavior -> EnvBehavior -> Bool
Eq, Int -> EnvBehavior -> ShowS
[EnvBehavior] -> ShowS
EnvBehavior -> [Char]
(Int -> EnvBehavior -> ShowS)
-> (EnvBehavior -> [Char])
-> ([EnvBehavior] -> ShowS)
-> Show EnvBehavior
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> EnvBehavior -> ShowS
showsPrec :: Int -> EnvBehavior -> ShowS
$cshow :: EnvBehavior -> [Char]
show :: EnvBehavior -> [Char]
$cshowList :: [EnvBehavior] -> ShowS
showList :: [EnvBehavior] -> ShowS
Show)
getOptions :: String -> [String] -> IO Options
getOptions :: [Char] -> [[Char]] -> IO Options
getOptions [Char]
progName [[Char]]
rawArgs = do
let ([Options -> Options]
actions, [[Char]]
args, [[Char]]
errs) = ArgOrder (Options -> Options)
-> [OptDescr (Options -> Options)]
-> [[Char]]
-> ([Options -> Options], [[Char]], [[Char]])
forall a.
ArgOrder a -> [OptDescr a] -> [[Char]] -> ([a], [[Char]], [[Char]])
getOpt ArgOrder (Options -> Options)
forall a. ArgOrder a
RequireOrder [OptDescr (Options -> Options)]
luaOptions [[Char]]
rawArgs
Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless ([[Char]] -> Bool
forall a. [a] -> Bool
forall (t :: * -> *) a. Foldable t => t a -> Bool
null [[Char]]
errs) (IO () -> IO ()) -> ([Char] -> IO ()) -> [Char] -> IO ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. IOError -> IO ()
forall a. HasCallStack => IOError -> IO a
ioError (IOError -> IO ()) -> ([Char] -> IOError) -> [Char] -> IO ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [Char] -> IOError
userError ([Char] -> IO ()) -> [Char] -> IO ()
forall a b. (a -> b) -> a -> b
$
let usageHead :: [Char]
usageHead = [Char]
"Usage: " [Char] -> ShowS
forall a. [a] -> [a] -> [a]
++ [Char]
progName [Char] -> ShowS
forall a. [a] -> [a] -> [a]
++ [Char]
" [options] [script [args]]"
in [[Char]] -> [Char]
forall (t :: * -> *) a. Foldable t => t [a] -> [a]
concat [[Char]]
errs [Char] -> ShowS
forall a. [a] -> [a] -> [a]
++ [Char] -> [OptDescr (Options -> Options)] -> [Char]
forall a. [Char] -> [OptDescr a] -> [Char]
usageInfo [Char]
usageHead [OptDescr (Options -> Options)]
luaOptions
let (Maybe [Char]
mscript, [[Char]]
arg) = ([[Char]] -> Maybe [Char])
-> ([[Char]], [[Char]]) -> (Maybe [Char], [[Char]])
forall a b c. (a -> b) -> (a, c) -> (b, c)
forall (p :: * -> * -> *) a b c.
Bifunctor p =>
(a -> b) -> p a c -> p b c
first [[Char]] -> Maybe [Char]
forall a. [a] -> Maybe a
listToMaybe (([[Char]], [[Char]]) -> (Maybe [Char], [[Char]]))
-> ([[Char]], [[Char]]) -> (Maybe [Char], [[Char]])
forall a b. (a -> b) -> a -> b
$ Int -> [[Char]] -> ([[Char]], [[Char]])
forall a. Int -> [a] -> ([a], [a])
splitAt Int
1 [[Char]]
args
let opts :: Options
opts = (Options -> (Options -> Options) -> Options)
-> Options -> [Options -> Options] -> Options
forall b a. (b -> a -> b) -> b -> [a] -> b
forall (t :: * -> *) b a.
Foldable t =>
(b -> a -> b) -> b -> t a -> b
foldl' (((Options -> Options) -> Options -> Options)
-> Options -> (Options -> Options) -> Options
forall a b c. (a -> b -> c) -> b -> a -> c
flip (Options -> Options) -> Options -> Options
forall a b. (a -> b) -> a -> b
($)) Options
defaultLuaOpts [Options -> Options]
actions
Options -> IO Options
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Options
opts
{ optScript = mscript
, optScriptArgs = arg
, optProgName = progName
, optAllArgs = rawArgs
}
showVersion :: Text -> LuaE e ()
showVersion :: forall e. Text -> LuaE e ()
showVersion Text
extraInfo = do
let copyrightString :: Text
copyrightString = [Char] -> Text
T.pack [Char]
LUA_COPYRIGHT
IO () -> LuaE e ()
forall a. IO a -> LuaE e a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
Lua.liftIO (IO () -> LuaE e ()) -> (Text -> IO ()) -> Text -> LuaE e ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> IO ()
T.putStrLn (Text -> LuaE e ()) -> Text -> LuaE e ()
forall a b. (a -> b) -> a -> b
$ Text
copyrightString Text -> Text -> Text
`T.append` Text
extraInfo
runCode :: LuaError e => LuaCode -> LuaE e ()
runCode :: forall e. LuaError e => LuaCode -> LuaE e ()
runCode = \case
ExecuteCode ByteString
stat -> do
status <- ByteString -> LuaE e Status
forall e. ByteString -> LuaE e Status
Lua.dostringTrace ByteString
stat
when (status /= Lua.OK)
Lua.throwErrorAsException
RequireModule Name
g Name
mod' -> do
_ <- Name -> LuaE e Type
forall e. LuaError e => Name -> LuaE e Type
Lua.getglobal Name
"require"
Lua.pushName mod'
status <- Lua.pcallTrace 1 1
if status == Lua.OK
then Lua.setglobal g
else Lua.throwErrorAsException
runStandalone :: LuaError e
=> Settings e
-> String
-> [String]
-> IO ()
runStandalone :: forall e. LuaError e => Settings e -> [Char] -> [[Char]] -> IO ()
runStandalone Settings e
settings [Char]
progName [[Char]]
args = do
opts <- [Char] -> [[Char]] -> IO Options
getOptions [Char]
progName [[Char]]
args
let envVarOpt = if Options -> Bool
optNoEnv Options
opts
then EnvBehavior
IgnoreEnvVars
else EnvBehavior
ConsultEnvVars
settingsRunner settings envVarOpt $ do
when (optVersion opts) (showVersion $ settingsVersionInfo settings)
case optScript opts of
Just [Char]
_script -> do
let setField :: Integer -> [Char] -> LuaE e ()
setField Integer
i [Char]
x = [Char] -> LuaE e ()
forall e. [Char] -> LuaE e ()
Lua.pushString [Char]
x LuaE e () -> LuaE e () -> LuaE e ()
forall a b. LuaE e a -> LuaE e b -> LuaE e b
forall (f :: * -> *) a b. Applicative f => f a -> f b -> f b
*> StackIndex -> Integer -> LuaE e ()
forall e. LuaError e => StackIndex -> Integer -> LuaE e ()
Lua.rawseti (CInt -> StackIndex
Lua.nth CInt
2) Integer
i
let nprogargs :: Int
nprogargs = [[Char]] -> Int
forall a. [a] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length (Options -> [[Char]]
optAllArgs Options
opts) Int -> Int -> Int
forall a. Num a => a -> a -> a
- [[Char]] -> Int
forall a. [a] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length (Options -> [[Char]]
optScriptArgs Options
opts)
let arg :: [[Char]]
arg = Options -> [Char]
optProgName Options
opts [Char] -> [[Char]] -> [[Char]]
forall a. a -> [a] -> [a]
: Options -> [[Char]]
optAllArgs Options
opts
LuaE e ()
forall e. LuaE e ()
Lua.newtable
(Integer -> [Char] -> LuaE e ())
-> [Integer] -> [[Char]] -> LuaE e ()
forall (m :: * -> *) a b c.
Applicative m =>
(a -> b -> m c) -> [a] -> [b] -> m ()
zipWithM_ Integer -> [Char] -> LuaE e ()
forall {e}. LuaError e => Integer -> [Char] -> LuaE e ()
setField [-(Int -> Integer
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
nprogargs)..] [[Char]]
arg
Maybe [Char]
Nothing -> do
([Char] -> LuaE e ()) -> [[Char]] -> LuaE e ()
forall e a. LuaError e => Pusher e a -> [a] -> LuaE e ()
Lua.pushList [Char] -> LuaE e ()
forall e. [Char] -> LuaE e ()
Lua.pushString (Options -> [[Char]]
optAllArgs Options
opts)
[Char] -> LuaE e ()
forall e. [Char] -> LuaE e ()
Lua.pushString (Options -> [Char]
optProgName Options
opts)
StackIndex -> Integer -> LuaE e ()
forall e. LuaError e => StackIndex -> Integer -> LuaE e ()
Lua.rawseti (CInt -> StackIndex
Lua.nth CInt
2) Integer
0
Lua.setglobal "arg"
when (optWarnings opts) $ do
l <- Lua.state
Lua.liftIO $ withCString "@on" $ \CString
w -> State -> CString -> LuaBool -> IO ()
Lua.lua_warning State
l CString
w LuaBool
Lua.FALSE
unless (optNoEnv opts) $ do
init' <- Lua.liftIO $ lookupEnv "LUA_INIT"
(case init' of
Just (Char
'@' : [Char]
filename) -> Maybe [Char] -> LuaE e Status
forall e. Maybe [Char] -> LuaE e Status
Lua.dofileTrace ([Char] -> Maybe [Char]
forall a. a -> Maybe a
Just [Char]
filename)
Just [Char]
cmd -> ByteString -> LuaE e Status
forall e. ByteString -> LuaE e Status
Lua.dostring ([Char] -> ByteString
UTF8.fromString [Char]
cmd)
Maybe [Char]
Nothing -> Status -> LuaE e Status
forall a. a -> LuaE e a
forall (m :: * -> *) a. Monad m => a -> m a
return Status
Lua.OK)
>>= \case
Status
Lua.OK -> () -> LuaE e ()
forall a. a -> LuaE e a
forall (f :: * -> *) a. Applicative f => a -> f a
pure ()
Status
_ -> LuaE e ()
forall e a. LuaError e => LuaE e a
Lua.throwErrorAsException
mapM_ runCode (reverse $ optExecute opts)
let nargs = Int -> NumArgs
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> NumArgs) -> ([[Char]] -> Int) -> [[Char]] -> NumArgs
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [[Char]] -> Int
forall a. [a] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length ([[Char]] -> NumArgs) -> [[Char]] -> NumArgs
forall a b. (a -> b) -> a -> b
$ Options -> [[Char]]
optScriptArgs Options
opts
let startREPL = do
Config -> LuaE e ()
forall e. Config -> LuaE e ()
setup Config
defaultConfig
{ replHistory = settingsHistory settings
, replInfo = replInfo defaultConfig `T.append`
settingsVersionInfo settings
}
LuaE e NumResults -> LuaE e ()
forall (f :: * -> *) a. Functor f => f a -> f ()
void LuaE e NumResults
forall e. LuaError e => LuaE e NumResults
repl
let handleScriptResult = \case
Status
Lua.OK -> do
([Char] -> LuaE e ()) -> [[Char]] -> LuaE e ()
forall (t :: * -> *) (m :: * -> *) a b.
(Foldable t, Monad m) =>
(a -> m b) -> t a -> m ()
mapM_ [Char] -> LuaE e ()
forall e. [Char] -> LuaE e ()
Lua.pushString (Options -> [[Char]]
optScriptArgs Options
opts)
status <- NumArgs -> NumResults -> LuaE e Status
forall e. NumArgs -> NumResults -> LuaE e Status
Lua.pcallTrace NumArgs
nargs NumResults
Lua.multret
when (status /= Lua.OK)
Lua.throwErrorAsException
when (optInteractive opts)
startREPL
Status
_ -> LuaE e ()
forall e a. LuaError e => LuaE e a
Lua.throwErrorAsException
tty <- Lua.liftIO istty
case optScript opts of
Just [Char]
"-" ->
Maybe [Char] -> LuaE e Status
forall e. Maybe [Char] -> LuaE e Status
Lua.loadfile Maybe [Char]
forall a. Maybe a
Nothing LuaE e Status -> (Status -> LuaE e ()) -> LuaE e ()
forall a b. LuaE e a -> (a -> LuaE e b) -> LuaE e b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= Status -> LuaE e ()
handleScriptResult
Just [Char]
script ->
Maybe [Char] -> LuaE e Status
forall e. Maybe [Char] -> LuaE e Status
Lua.loadfile ([Char] -> Maybe [Char]
forall a. a -> Maybe a
Just [Char]
script) LuaE e Status -> (Status -> LuaE e ()) -> LuaE e ()
forall a b. LuaE e a -> (a -> LuaE e b) -> LuaE e b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= Status -> LuaE e ()
handleScriptResult
Maybe [Char]
_ | Options -> Bool
optInteractive Options
opts -> do
startREPL
Maybe [Char]
_ | Options -> Bool
optVersion Options
opts Bool -> Bool -> Bool
|| Bool -> Bool
not ([LuaCode] -> Bool
forall a. [a] -> Bool
forall (t :: * -> *) a. Foldable t => t a -> Bool
null (Options -> [LuaCode]
optExecute Options
opts)) ->
() -> LuaE e ()
forall a. a -> LuaE e a
forall (f :: * -> *) a. Applicative f => a -> f a
pure ()
Maybe [Char]
_ | Bool
tty -> do
startREPL
Maybe [Char]
_ -> do
Maybe [Char] -> LuaE e Status
forall e. Maybe [Char] -> LuaE e Status
Lua.loadfile Maybe [Char]
forall a. Maybe a
Nothing LuaE e Status -> (Status -> LuaE e ()) -> LuaE e ()
forall a b. LuaE e a -> (a -> LuaE e b) -> LuaE e b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= Status -> LuaE e ()
handleScriptResult
data LuaCode =
ExecuteCode ByteString
| RequireModule Lua.Name Lua.Name
data Options = Options
{ Options -> Bool
optNoEnv :: Bool
, Options -> Bool
optInteractive :: Bool
, Options -> Bool
optVersion :: Bool
, Options -> Bool
optWarnings :: Bool
, Options -> [LuaCode]
optExecute :: [LuaCode]
, Options -> [Char]
optProgName :: String
, Options -> [[Char]]
optAllArgs :: [String]
, Options -> Maybe [Char]
optScript :: Maybe String
, Options -> [[Char]]
optScriptArgs :: [String]
}
defaultLuaOpts :: Options
defaultLuaOpts :: Options
defaultLuaOpts = Options
{ optNoEnv :: Bool
optNoEnv = Bool
False
, optInteractive :: Bool
optInteractive = Bool
False
, optVersion :: Bool
optVersion = Bool
False
, optWarnings :: Bool
optWarnings = Bool
False
, optExecute :: [LuaCode]
optExecute = [LuaCode]
forall a. Monoid a => a
mempty
, optProgName :: [Char]
optProgName = [Char]
forall a. Monoid a => a
mempty
, optAllArgs :: [[Char]]
optAllArgs = [[Char]]
forall a. Monoid a => a
mempty
, optScript :: Maybe [Char]
optScript = Maybe [Char]
forall a. Maybe a
Nothing
, optScriptArgs :: [[Char]]
optScriptArgs = [[Char]]
forall a. Monoid a => a
mempty
}
luaOptions :: [OptDescr (Options -> Options)]
luaOptions :: [OptDescr (Options -> Options)]
luaOptions =
[ [Char]
-> [[Char]]
-> ArgDescr (Options -> Options)
-> [Char]
-> OptDescr (Options -> Options)
forall a. [Char] -> [[Char]] -> ArgDescr a -> [Char] -> OptDescr a
Option [Char]
"e" []
((([Char] -> Options -> Options)
-> [Char] -> ArgDescr (Options -> Options))
-> [Char]
-> ([Char] -> Options -> Options)
-> ArgDescr (Options -> Options)
forall a b c. (a -> b -> c) -> b -> a -> c
flip ([Char] -> Options -> Options)
-> [Char] -> ArgDescr (Options -> Options)
forall a. ([Char] -> a) -> [Char] -> ArgDescr a
ReqArg [Char]
"stat" (([Char] -> Options -> Options) -> ArgDescr (Options -> Options))
-> ([Char] -> Options -> Options) -> ArgDescr (Options -> Options)
forall a b. (a -> b) -> a -> b
$ \[Char]
stat Options
opt ->
let code :: LuaCode
code = ByteString -> LuaCode
ExecuteCode (ByteString -> LuaCode) -> ByteString -> LuaCode
forall a b. (a -> b) -> a -> b
$ [Char] -> ByteString
UTF8.fromString [Char]
stat
in Options
opt{ optExecute = code:optExecute opt })
[Char]
"execute string 'stat'"
, [Char]
-> [[Char]]
-> ArgDescr (Options -> Options)
-> [Char]
-> OptDescr (Options -> Options)
forall a. [Char] -> [[Char]] -> ArgDescr a -> [Char] -> OptDescr a
Option [Char]
"i" []
((Options -> Options) -> ArgDescr (Options -> Options)
forall a. a -> ArgDescr a
NoArg ((Options -> Options) -> ArgDescr (Options -> Options))
-> (Options -> Options) -> ArgDescr (Options -> Options)
forall a b. (a -> b) -> a -> b
$ \Options
opt -> Options
opt { optInteractive = True })
[Char]
"interactive mode"
, [Char]
-> [[Char]]
-> ArgDescr (Options -> Options)
-> [Char]
-> OptDescr (Options -> Options)
forall a. [Char] -> [[Char]] -> ArgDescr a -> [Char] -> OptDescr a
Option [Char]
"l" []
((([Char] -> Options -> Options)
-> [Char] -> ArgDescr (Options -> Options))
-> [Char]
-> ([Char] -> Options -> Options)
-> ArgDescr (Options -> Options)
forall a b c. (a -> b -> c) -> b -> a -> c
flip ([Char] -> Options -> Options)
-> [Char] -> ArgDescr (Options -> Options)
forall a. ([Char] -> a) -> [Char] -> ArgDescr a
ReqArg [Char]
"mod" (([Char] -> Options -> Options) -> ArgDescr (Options -> Options))
-> ([Char] -> Options -> Options) -> ArgDescr (Options -> Options)
forall a b. (a -> b) -> a -> b
$ \[Char]
mod' Options
opt ->
let toName :: [Char] -> Name
toName = ByteString -> Name
Lua.Name (ByteString -> Name) -> ([Char] -> ByteString) -> [Char] -> Name
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [Char] -> ByteString
UTF8.fromString
code :: LuaCode
code = case (Char -> Bool) -> [Char] -> ([Char], [Char])
forall a. (a -> Bool) -> [a] -> ([a], [a])
break (Char -> Char -> Bool
forall a. Eq a => a -> a -> Bool
== Char
'=') [Char]
mod' of
([Char]
glb, Char
'=':[Char]
m) -> Name -> Name -> LuaCode
RequireModule ([Char] -> Name
toName [Char]
glb) ([Char] -> Name
toName [Char]
m)
([Char]
glb, [Char]
_ ) -> Name -> Name -> LuaCode
RequireModule ([Char] -> Name
toName [Char]
glb) ([Char] -> Name
toName [Char]
glb)
in Options
opt{ optExecute = code:optExecute opt })
([[Char]] -> [Char]
unlines
[ [Char]
"require library 'mod' into global 'mod';"
, [Char]
"if 'mod' has the pattern 'g=module', then"
, [Char]
"require library 'module' into global 'g'"
])
, [Char]
-> [[Char]]
-> ArgDescr (Options -> Options)
-> [Char]
-> OptDescr (Options -> Options)
forall a. [Char] -> [[Char]] -> ArgDescr a -> [Char] -> OptDescr a
Option [Char]
"v" []
((Options -> Options) -> ArgDescr (Options -> Options)
forall a. a -> ArgDescr a
NoArg ((Options -> Options) -> ArgDescr (Options -> Options))
-> (Options -> Options) -> ArgDescr (Options -> Options)
forall a b. (a -> b) -> a -> b
$ \Options
opt -> Options
opt { optVersion = True })
[Char]
"show version information"
, [Char]
-> [[Char]]
-> ArgDescr (Options -> Options)
-> [Char]
-> OptDescr (Options -> Options)
forall a. [Char] -> [[Char]] -> ArgDescr a -> [Char] -> OptDescr a
Option [Char]
"E" []
((Options -> Options) -> ArgDescr (Options -> Options)
forall a. a -> ArgDescr a
NoArg ((Options -> Options) -> ArgDescr (Options -> Options))
-> (Options -> Options) -> ArgDescr (Options -> Options)
forall a b. (a -> b) -> a -> b
$ \Options
opt -> Options
opt { optNoEnv = True })
[Char]
"ignore environment variables -- partially supported"
, [Char]
-> [[Char]]
-> ArgDescr (Options -> Options)
-> [Char]
-> OptDescr (Options -> Options)
forall a. [Char] -> [[Char]] -> ArgDescr a -> [Char] -> OptDescr a
Option [Char]
"W" []
((Options -> Options) -> ArgDescr (Options -> Options)
forall a. a -> ArgDescr a
NoArg ((Options -> Options) -> ArgDescr (Options -> Options))
-> (Options -> Options) -> ArgDescr (Options -> Options)
forall a b. (a -> b) -> a -> b
$ \Options
opt -> Options
opt { optWarnings = True })
[Char]
"turn warnings on -- currently not supported"
]