diff options
Diffstat (limited to 'utils/ghc-pwd/ghc-pwd.hs')
-rw-r--r-- | utils/ghc-pwd/ghc-pwd.hs | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/utils/ghc-pwd/ghc-pwd.hs b/utils/ghc-pwd/ghc-pwd.hs new file mode 100644 index 0000000000..91a5606ac3 --- /dev/null +++ b/utils/ghc-pwd/ghc-pwd.hs @@ -0,0 +1,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 + |