forked from GitHub/gf-core
Move welcome message from GF.Interactive & GF.Interactive2 to GF.Command.Messages
...to avoid the duplication.
This commit is contained in:
@@ -1,5 +1,30 @@
|
|||||||
module GF.Command.Messages where
|
module GF.Command.Messages where
|
||||||
|
|
||||||
|
import GF.Infra.BuildInfo(buildInfo)
|
||||||
|
import Data.Version(showVersion)
|
||||||
|
import Paths_gf(version)
|
||||||
|
|
||||||
|
|
||||||
|
welcome = unlines [
|
||||||
|
" ",
|
||||||
|
" * * * ",
|
||||||
|
" * * ",
|
||||||
|
" * * ",
|
||||||
|
" * ",
|
||||||
|
" * ",
|
||||||
|
" * * * * * * * ",
|
||||||
|
" * * * ",
|
||||||
|
" * * * * * * ",
|
||||||
|
" * * * ",
|
||||||
|
" * * * ",
|
||||||
|
" ",
|
||||||
|
"This is GF version "++showVersion version++". ",
|
||||||
|
buildInfo,
|
||||||
|
"License: see help -license. "--,
|
||||||
|
-- Google Code is shutting down August 2015
|
||||||
|
--"Bug reports: http://code.google.com/p/grammatical-framework/issues/list"
|
||||||
|
]
|
||||||
|
|
||||||
licenseMsg = unlines [
|
licenseMsg = unlines [
|
||||||
"Copyright (c)",
|
"Copyright (c)",
|
||||||
"Krasimir Angelov, Bj\246rn Bringert, H\229kan Burden, Hans-Joachim Daniels,",
|
"Krasimir Angelov, Bj\246rn Bringert, H\229kan Burden, Hans-Joachim Daniels,",
|
||||||
|
|||||||
@@ -49,9 +49,7 @@ import GF.Server(server)
|
|||||||
#endif
|
#endif
|
||||||
import GF.System.Console(changeConsoleEncoding)
|
import GF.System.Console(changeConsoleEncoding)
|
||||||
|
|
||||||
import GF.Infra.BuildInfo(buildInfo)
|
import GF.Command.Messages(welcome)
|
||||||
import Data.Version(showVersion)
|
|
||||||
import Paths_gf(version)
|
|
||||||
|
|
||||||
-- | Run the GF Shell in quiet mode (@gf -run@).
|
-- | Run the GF Shell in quiet mode (@gf -run@).
|
||||||
mainRunGFI :: Options -> [FilePath] -> IO ()
|
mainRunGFI :: Options -> [FilePath] -> IO ()
|
||||||
@@ -378,25 +376,6 @@ tryGetLine = do
|
|||||||
Left (e :: SomeException) -> return "q"
|
Left (e :: SomeException) -> return "q"
|
||||||
Right l -> return l
|
Right l -> return l
|
||||||
|
|
||||||
welcome = unlines [
|
|
||||||
" ",
|
|
||||||
" * * * ",
|
|
||||||
" * * ",
|
|
||||||
" * * ",
|
|
||||||
" * ",
|
|
||||||
" * ",
|
|
||||||
" * * * * * * * ",
|
|
||||||
" * * * ",
|
|
||||||
" * * * * * * ",
|
|
||||||
" * * * ",
|
|
||||||
" * * * ",
|
|
||||||
" ",
|
|
||||||
"This is GF version "++showVersion version++". ",
|
|
||||||
buildInfo,
|
|
||||||
"License: see help -license. ",
|
|
||||||
"Bug reports: http://code.google.com/p/grammatical-framework/issues/list"
|
|
||||||
]
|
|
||||||
|
|
||||||
prompt env
|
prompt env
|
||||||
| retain env || abs == wildCId = "> "
|
| retain env || abs == wildCId = "> "
|
||||||
| otherwise = showCId abs ++ "> "
|
| otherwise = showCId abs ++ "> "
|
||||||
|
|||||||
@@ -53,9 +53,7 @@ import GF.Server(server)
|
|||||||
-}
|
-}
|
||||||
import GF.System.Console(changeConsoleEncoding)
|
import GF.System.Console(changeConsoleEncoding)
|
||||||
|
|
||||||
import GF.Infra.BuildInfo(buildInfo)
|
import GF.Command.Messages(welcome)
|
||||||
import Data.Version(showVersion)
|
|
||||||
import Paths_gf(version)
|
|
||||||
|
|
||||||
-- | Run the GF Shell in quiet mode (@gf -run@).
|
-- | Run the GF Shell in quiet mode (@gf -run@).
|
||||||
mainRunGFI :: Options -> [FilePath] -> IO ()
|
mainRunGFI :: Options -> [FilePath] -> IO ()
|
||||||
@@ -67,6 +65,7 @@ beQuiet = addOptions (modifyFlags (\f -> f{optVerbosity=Quiet}))
|
|||||||
mainGFI :: Options -> [FilePath] -> IO ()
|
mainGFI :: Options -> [FilePath] -> IO ()
|
||||||
mainGFI opts files = do
|
mainGFI opts files = do
|
||||||
P.putStrLn welcome
|
P.putStrLn welcome
|
||||||
|
P.putStrLn "This shell uses the C run-time system. See help for available commands."
|
||||||
shell opts files
|
shell opts files
|
||||||
|
|
||||||
shell opts files = loop opts =<< runSIO (importInEnv emptyGFEnv opts files)
|
shell opts files = loop opts =<< runSIO (importInEnv emptyGFEnv opts files)
|
||||||
@@ -383,27 +382,6 @@ tryGetLine = do
|
|||||||
Left (e :: SomeException) -> return "q"
|
Left (e :: SomeException) -> return "q"
|
||||||
Right l -> return l
|
Right l -> return l
|
||||||
|
|
||||||
welcome = unlines [
|
|
||||||
" ",
|
|
||||||
" * * * ",
|
|
||||||
" * * ",
|
|
||||||
" * * ",
|
|
||||||
" * ",
|
|
||||||
" * ",
|
|
||||||
" * * * * * * * ",
|
|
||||||
" * * * ",
|
|
||||||
" * * * * * * ",
|
|
||||||
" * * * ",
|
|
||||||
" * * * ",
|
|
||||||
" ",
|
|
||||||
"This is GF version "++showVersion version++". ",
|
|
||||||
buildInfo,
|
|
||||||
"License: see help -license. ",
|
|
||||||
--"Bug reports: http://code.google.com/p/grammatical-framework/issues/list",
|
|
||||||
"",
|
|
||||||
"This shell uses the C run-time system. See help for available commands."
|
|
||||||
]
|
|
||||||
|
|
||||||
prompt env = abs ++ "> "
|
prompt env = abs ++ "> "
|
||||||
where
|
where
|
||||||
abs = maybe "" C.abstractName (multigrammar (commandenv env))
|
abs = maybe "" C.abstractName (multigrammar (commandenv env))
|
||||||
|
|||||||
Reference in New Issue
Block a user