This commit is contained in:
aarne
2004-09-23 14:41:42 +00:00
parent d5b4230d6d
commit 2c60a2d82a
31 changed files with 434 additions and 211 deletions

View File

@@ -6,6 +6,7 @@ import Option
import ShellState
import ShellCommands
import Shell
import CommandL (execCommandHistory)
import SubShell
import PShell
import JGF
@@ -14,14 +15,14 @@ import Char (isSpace)
-- separated from GF Main 24/6/2003
gfInteract :: HState -> IO HState
gfInteract st@(env,_) = do
gfInteract st@(env,hist) = do
-- putStrFlush "> " M.F 25/01-02 prompt moved to Arch.
(s,cs) <- getCommandLines
case ifImpure cs of
-- these are the three impure commands
Just (ICQuit,_) -> do
putStrLnFlush "See you."
ifNotSilent "See you."
return st
Just (ICExecuteHistory file,_) -> do
ss <- readFileIf file
@@ -34,8 +35,13 @@ gfInteract st@(env,_) = do
st' <- execLinesH line [co] st -- s would not work in execLinesH
gfInteract st'
Just (ICEditSession,os) ->
editSession (addOptions os opts) env >> gfInteract st
Just (ICEditSession,os) -> case getOptVal os useFile of
Just file -> do
s <- readFileIf file
(env',tree) <- execCommandHistory env s
gfInteract st
_ ->
editSession (addOptions os opts) env >> gfInteract st
Just (ICTranslateSession,os) ->
translateSession (addOptions os opts) env >> gfInteract st
@@ -45,6 +51,8 @@ gfInteract st@(env,_) = do
gfInteract st'
where
opts = globalOptions env
ifNotSilent c =
if oElem beSilent opts then return () else putStrLnFlush c
gfBatch :: HState -> IO HState
gfBatch st@(sh,_) = do