Makefile tweak
[ghc-hetmet.git] / utils / ghc-pwd / Main.hs
1
2 module Main where
3
4 import System.Directory
5 import System.Environment
6 import System.Exit
7 import System.IO
8
9 main :: IO ()
10 main = do
11     args <- getArgs
12     case args of
13         [] -> do d <- getCurrentDirectory
14                  putStr $ map forwardifySlashes d
15         _ -> do hPutStrLn stderr ("Bad args: " ++ show args)
16                 hPutStrLn stderr "Usage: ghc-pwd"
17                 exitFailure
18
19 forwardifySlashes :: Char -> Char
20 forwardifySlashes '\\' = '/'
21 forwardifySlashes c = c
22