mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-22 19:22:50 -06:00
do the cyrilic trick for Windows in gf3 also
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
{-# OPTIONS -cpp #-}
|
||||||
module Main where
|
module Main where
|
||||||
|
|
||||||
import GFC
|
import GFC
|
||||||
@@ -11,15 +12,24 @@ import Data.Version
|
|||||||
import System.Environment (getArgs)
|
import System.Environment (getArgs)
|
||||||
import System.Exit
|
import System.Exit
|
||||||
import System.IO
|
import System.IO
|
||||||
|
#ifdef mingw32_HOST_OS
|
||||||
|
import System.Win32.Console
|
||||||
|
import System.Win32.NLS
|
||||||
|
#endif
|
||||||
|
|
||||||
main :: IO ()
|
main :: IO ()
|
||||||
main =
|
main = do
|
||||||
do args <- getArgs
|
#ifdef mingw32_HOST_OS
|
||||||
case parseOptions args of
|
codepage <- getACP
|
||||||
Ok (opts,files) -> mainOpts opts files
|
setConsoleCP codepage
|
||||||
Bad err -> do hPutStrLn stderr err
|
setConsoleOutputCP codepage
|
||||||
hPutStrLn stderr "You may want to try --help."
|
#endif
|
||||||
exitFailure
|
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 :: Options -> [FilePath] -> IO ()
|
||||||
mainOpts opts files =
|
mainOpts opts files =
|
||||||
|
|||||||
Reference in New Issue
Block a user