summaryrefslogtreecommitdiff
path: root/src/GF/GFModes.hs
diff options
context:
space:
mode:
authoraarne <unknown>2004-09-23 14:41:42 +0000
committeraarne <unknown>2004-09-23 14:41:42 +0000
commit2c60a2d82a0d7b90924e7dbbcacf36afb8549d17 (patch)
tree0a04734e741c294cb9f58cfdcafa2ff2b55894dd /src/GF/GFModes.hs
parentd5b4230d6dbee8c03eedf8d181dfa2badf1a954b (diff)
Ints n
Diffstat (limited to 'src/GF/GFModes.hs')
-rw-r--r--src/GF/GFModes.hs16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/GF/GFModes.hs b/src/GF/GFModes.hs
index 6944dd0d3..3c9d59f04 100644
--- a/src/GF/GFModes.hs
+++ b/src/GF/GFModes.hs
@@ -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