-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Command-line interface for Lua
--   
--   Provides an embeddable command-line interface for Lua. The interface
--   is compatible with the standard Lua interpreter, i.e., the <a>lua</a>
--   executable provided in a default Lua installation.
@package hslua-cli
@version 1.4.3


-- | Embeddable Lua interpreter interface.
module HsLua.CLI

-- | Uses the first command line argument as the name of a script file and
--   tries to run that script in Lua. Falls back to stdin if no file is
--   given. Any remaining args are passed to Lua via the global table
--   <tt>arg</tt>.
runStandalone :: LuaError e => Settings e -> String -> [String] -> IO ()

-- | Settings for the Lua command line interface.
--   
--   If env vars should be ignored, and the interpreter invokes
--   <tt>openlibs</tt>, then the registry key <tt>LUA_NOENV</tt> should be
--   set to <tt>true</tt> before that function is invoked. E.g.:
--   
--   <pre>
--   runner envBehavior action = run $ do
--     when (envBehavior == IgnoreEnvVars) $ do
--       pushboolean True
--       setfield registryindex "LUA_NOENV"
--     openlibs
--     action
--   </pre>
data Settings e
Settings :: Text -> (EnvBehavior -> LuaE e () -> IO ()) -> Maybe FilePath -> Settings e

-- | Additional version info to present to the user. The current Lua
--   version will always be printed.
[settingsVersionInfo] :: Settings e -> Text

-- | The Lua interpreter to be used; the first argument indicates whether
--   environment variables should be consulted or ignored.
[settingsRunner] :: Settings e -> EnvBehavior -> LuaE e () -> IO ()
[settingsHistory] :: Settings e -> Maybe FilePath

-- | Whether environment variables should be consulted or ignored.
data EnvBehavior
IgnoreEnvVars :: EnvBehavior
ConsultEnvVars :: EnvBehavior
instance GHC.Show.Show HsLua.CLI.EnvBehavior
instance GHC.Classes.Eq HsLua.CLI.EnvBehavior
