summaryrefslogtreecommitdiff
path: root/utils/ghc-pwd/Main.hs
blob: 91a5606ac32aa29adca5711102e7ac79f0215963 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22

module Main where

import System.Directory
import System.Environment
import System.Exit
import System.IO

main :: IO ()
main = do
    args <- getArgs
    case args of
        [] -> do d <- getCurrentDirectory
                 putStr $ map forwardifySlashes d
        _ -> do hPutStrLn stderr ("Bad args: " ++ show args)
                hPutStrLn stderr "Usage: ghc-pwd"
                exitFailure

forwardifySlashes :: Char -> Char
forwardifySlashes '\\' = '/'
forwardifySlashes c = c