1
0
forked from GitHub/gf-core

GF shell: restore the eh command to working order and document it

Also, when the command line parser fails, append the problematic command line
to the error message "command not parsed".
This commit is contained in:
hallgren
2015-08-18 13:13:31 +00:00
parent 17e7a01ae1
commit 41075fb50a
4 changed files with 39 additions and 18 deletions

View File

@@ -71,6 +71,11 @@ commonCommands = fmap (mapCommandExec liftSIO) $ Map.fromList [
longname = "empty",
synopsis = "empty the environment"
}),
("eh", emptyCommandInfo {
longname = "execute_history",
syntax = "eh FILE",
synopsis = "read commands from a file and execute them"
}),
("ph", emptyCommandInfo {
longname = "print_history",
synopsis = "print command history",

View File

@@ -27,7 +27,7 @@ interpretCommandLine env line =
case readCommandLine line of
Just [] -> return ()
Just pipes -> mapM_ (interpretPipe env) pipes
Nothing -> putStrLnE "command not parsed"
Nothing -> putStrLnE $ "command not parsed: "++line
interpretPipe env cs = do
Piped v@(_,s) <- intercs cs void