summaryrefslogtreecommitdiff
path: root/src/GF/Shell
diff options
context:
space:
mode:
authoraarne <unknown>2004-06-24 14:06:09 +0000
committeraarne <unknown>2004-06-24 14:06:09 +0000
commit3b39607bbac8e6ab99198ab608f14e1f84c2f60e (patch)
tree35b823c38ef0ed7439f1a057d939fbdfa96bc719 /src/GF/Shell
parentd3db78ad31fe8b27c7ebb4e05b92d4c3986cb119 (diff)
last-minute bug fixes
Diffstat (limited to 'src/GF/Shell')
-rw-r--r--src/GF/Shell/CommandL.hs6
-rw-r--r--src/GF/Shell/Commands.hs11
-rw-r--r--src/GF/Shell/ShellCommands.hs5
3 files changed, 15 insertions, 7 deletions
diff --git a/src/GF/Shell/CommandL.hs b/src/GF/Shell/CommandL.hs
index 5945dd271..36e8a5a6d 100644
--- a/src/GF/Shell/CommandL.hs
+++ b/src/GF/Shell/CommandL.hs
@@ -20,7 +20,7 @@ import UTF8
initEditLoop :: CEnv -> IO () -> IO ()
initEditLoop env resume = do
- let env' = addGlobalOptions (options [sizeDisplay "short"]) env
+ let env' = startEditEnv env
putStrLnFlush $ initEditMsg env'
let state = initSStateEnv env'
putStrLnFlush $ showCurrentState env' state
@@ -113,7 +113,9 @@ pCommand = pCommandWords . words where
-- well, this lists the commands of the line-based editor
initEditMsg env = unlines $
"State-dependent editing commands are given in the menu:" :
- " n = new, r = refine, w = wrap, d = delete, s = select." :
+ " n [Cat] = new, r [Fun] = refine, w [Fun] [Int] = wrap,":
+ " ch [Fun] = change head, d = delete, s [Int] = select," :
+ " x [Var] [Var] = alpha convert." :
"Commands changing the environment:" :
" i [file] = import, e = empty." :
"Other commands:" :
diff --git a/src/GF/Shell/Commands.hs b/src/GF/Shell/Commands.hs
index 25ef5607f..9bf1f8ff2 100644
--- a/src/GF/Shell/Commands.hs
+++ b/src/GF/Shell/Commands.hs
@@ -26,6 +26,7 @@ import Unicode
import CF
import CFIdent (cat2CFCat, cfCat2Cat)
+import PPrCF (prCFCat)
import Linear
import Randomized
import Editing
@@ -130,10 +131,10 @@ execCommand env c s = case c of
CCEnvEmptyAndImport file -> useIOE (emptyShellState, initSState) $ do
st <- shellStateFromFiles opts emptyShellState file
- return (st,s)
+ return (startEditEnv st,s)
CCEnvEmpty -> do
- return (emptyShellState, initSState)
+ return (startEditEnv emptyShellState, initSState)
CCEnvGFShell command -> do
let cs = PShell.pCommandLines command
@@ -224,7 +225,7 @@ execECommand env c = case c of
let cat = cat2CFCat (qualifTop sgr (actCat (stateSState s)))
ts = parseAny agrs cat str
in (if null ts ---- debug
- then withMsg [str, "parse failed in cat" +++ show cat]
+ then withMsg [str, "parse failed in cat" +++ prCFCat cat]
else id)
(refineByTrees der cgr ts) s
@@ -270,6 +271,10 @@ string2varPair s = case words s of
x : y : [] -> liftM2 (,) (string2ident x) (string2ident y)
_ -> Bad "expected format 'x y'"
+
+
+startEditEnv env = addGlobalOptions (options [sizeDisplay "short"]) env
+
-- seen on display
cMenuDisplay :: String -> Command
diff --git a/src/GF/Shell/ShellCommands.hs b/src/GF/Shell/ShellCommands.hs
index 451776108..09de1cd24 100644
--- a/src/GF/Shell/ShellCommands.hs
+++ b/src/GF/Shell/ShellCommands.hs
@@ -136,7 +136,7 @@ optionsOfCommand co = case co of
CStripState -> none
CTransformGrammar _ -> flags "printer"
CConvertLatex _ -> none
- CLinearize _ -> both "table struct record all" "lang number unlexer"
+ CLinearize _ -> both "utf8 table struct record all" "lang number unlexer"
CParse -> both "new n ign raw v" "cat lang lexer parser number rawtrees"
CTranslate _ _ -> opts "cat lexer parser"
CGenerateRandom -> flags "cat lang number depth"
@@ -161,7 +161,8 @@ optionsOfCommand co = case co of
CShowTerm -> flags "printer"
CSystemCommand _ -> none
- CPrintGrammar -> flags "printer"
+ CPrintGrammar -> both "utf8" "printer"
+ CPrintMultiGrammar -> opts "utf8"
CHelp _ -> opts "all"