module System.Console.Shell (
ShellDescription (..)
, initialShellDescription
, mkShellDescription
, defaultExceptionHandler
, runShell
, exitCommand
, helpCommand
, toggle
, cmd
, CommandFunction
, File (..)
, Username (..)
, Completable (..)
, Completion (..)
, ShellCommand
, Subshell
, simpleSubshell
, showShellHelp
, showCmdHelp
, CommandStyle (..)
, ShellSpecial (..)
, OutputCommand
, CommandResult
, ShellacException
) where
import System.Console.Shell.Types
import System.Console.Shell.ShellMonad
import System.Console.Shell.Commands
import System.Console.Shell.RunShell
import System.Console.Shell.Backend
initialShellDescription :: ShellDescription st
initialShellDescription =
ShDesc
{ shellCommands = []
, commandStyle = CharPrefixCommands ':'
, evaluateFunc = \_ -> return ()
, greetingText = Nothing
, wordBreakChars = defaultWordBreakChars
, beforePrompt = return ()
, prompt = \_ -> return "> "
, secondaryPrompt = Nothing
, exceptionHandler = defaultExceptionHandler
, defaultCompletions = Just (\_ _ -> return [])
, historyFile = Nothing
, maxHistoryEntries = 100
, historyEnabled = True
}
mkShellDescription :: [ShellCommand st]
-> (String -> Sh st ())
-> ShellDescription st
mkShellDescription cmds func =
initialShellDescription
{ shellCommands = cmds
, evaluateFunc = func
}