diff options
| author | John J. Camilleri <john@digitalgrammars.com> | 2021-07-06 15:35:03 +0200 |
|---|---|---|
| committer | John J. Camilleri <john@digitalgrammars.com> | 2021-07-06 15:35:03 +0200 |
| commit | ef422164154e093b1231c2ee905c0539c0c0a1b3 (patch) | |
| tree | d1430334cb77dbe49dd4952f5d604772c8cfdc94 /src/compiler/GF/Main.hs | |
| parent | 0c3ca3d79acb34e0159cf6b51ba41ff570ad2af1 (diff) | |
Add import from command line invocation to command history
Closes #64
Diffstat (limited to 'src/compiler/GF/Main.hs')
| -rw-r--r-- | src/compiler/GF/Main.hs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/compiler/GF/Main.hs b/src/compiler/GF/Main.hs index 7cde1ce97..7d4500c7b 100644 --- a/src/compiler/GF/Main.hs +++ b/src/compiler/GF/Main.hs @@ -16,18 +16,19 @@ import Data.Version import System.Directory import System.Environment (getArgs) import System.Exit -import GF.System.Console (setConsoleEncoding) +-- import GF.System.Console (setConsoleEncoding) -- | Run the GF main program, taking arguments from the command line. -- (It calls 'setConsoleEncoding' and 'getOptions', then 'mainOpts'.) -- Run @gf --help@ for usage info. main :: IO () main = do - --setConsoleEncoding + -- setConsoleEncoding uncurry mainOpts =<< getOptions -- | Get and parse GF command line arguments. Fix relative paths. -- Calls 'getArgs' and 'parseOptions'. +getOptions :: IO (Options, [FilePath]) getOptions = do args <- getArgs case parseOptions args of @@ -43,7 +44,7 @@ getOptions = do -- the options it invokes 'mainGFC', 'mainGFI', 'mainRunGFI', 'mainServerGFI', -- or it just prints version/usage info. mainOpts :: Options -> [FilePath] -> IO () -mainOpts opts files = +mainOpts opts files = case flag optMode opts of ModeVersion -> putStrLn $ "Grammatical Framework (GF) version " ++ showVersion version ++ "\n" ++ buildInfo ModeHelp -> putStrLn helpMessage |
