mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-22 19:22:50 -06:00
changed names of resource-1.3; added a note on homepage on release
This commit is contained in:
41
src/GF.hs
Normal file
41
src/GF.hs
Normal file
@@ -0,0 +1,41 @@
|
||||
{-# OPTIONS -cpp #-}
|
||||
module Main where
|
||||
|
||||
import GFC
|
||||
import GFI
|
||||
import GF.Data.ErrM
|
||||
import GF.Infra.Option
|
||||
import GF.Infra.UseIO
|
||||
import Paths_gf
|
||||
|
||||
import Data.Version
|
||||
import System.Environment (getArgs)
|
||||
import System.Exit
|
||||
import System.IO
|
||||
#ifdef mingw32_HOST_OS
|
||||
import System.Win32.Console
|
||||
import System.Win32.NLS
|
||||
#endif
|
||||
|
||||
main :: IO ()
|
||||
main = do
|
||||
#ifdef mingw32_HOST_OS
|
||||
codepage <- getACP
|
||||
setConsoleCP codepage
|
||||
setConsoleOutputCP codepage
|
||||
#endif
|
||||
args <- getArgs
|
||||
case parseOptions args of
|
||||
Ok (opts,files) -> mainOpts opts files
|
||||
Bad err -> do hPutStrLn stderr err
|
||||
hPutStrLn stderr "You may want to try --help."
|
||||
exitFailure
|
||||
|
||||
mainOpts :: Options -> [FilePath] -> IO ()
|
||||
mainOpts opts files =
|
||||
case flag optMode opts of
|
||||
ModeVersion -> putStrLn $ "Grammatical Framework (GF) version " ++ showVersion version
|
||||
ModeHelp -> putStrLn helpMessage
|
||||
ModeInteractive -> mainGFI opts files
|
||||
ModeCompiler -> dieIOE (mainGFC opts files)
|
||||
|
||||
Reference in New Issue
Block a user