summaryrefslogtreecommitdiff
path: root/utils/ghc-pwd
diff options
context:
space:
mode:
authorIan Lynagh <igloo@earth.li>2009-05-07 13:50:34 +0000
committerIan Lynagh <igloo@earth.li>2009-05-07 13:50:34 +0000
commit36091517e6b1d87b8dacd5168fcc464ac75f65bd (patch)
tree4f1cb4d37de6523ea2f0322462d30b46551137b2 /utils/ghc-pwd
parented4beb8bc5e49d84e38b047c2dfc14eb22c74607 (diff)
downloadhaskell-36091517e6b1d87b8dacd5168fcc464ac75f65bd.tar.gz
Rename pwd to ghc-pwd
Diffstat (limited to 'utils/ghc-pwd')
-rw-r--r--utils/ghc-pwd/Setup.hs2
-rw-r--r--utils/ghc-pwd/ghc-pwd.cabal24
-rw-r--r--utils/ghc-pwd/ghc-pwd.hs22
3 files changed, 48 insertions, 0 deletions
diff --git a/utils/ghc-pwd/Setup.hs b/utils/ghc-pwd/Setup.hs
new file mode 100644
index 0000000000..9a994af677
--- /dev/null
+++ b/utils/ghc-pwd/Setup.hs
@@ -0,0 +1,2 @@
+import Distribution.Simple
+main = defaultMain
diff --git a/utils/ghc-pwd/ghc-pwd.cabal b/utils/ghc-pwd/ghc-pwd.cabal
new file mode 100644
index 0000000000..173b3cc1ee
--- /dev/null
+++ b/utils/ghc-pwd/ghc-pwd.cabal
@@ -0,0 +1,24 @@
+Name: ghc-pwd
+Version: 0.1
+Copyright: XXX
+License: BSD
+-- XXX License-File: LICENSE
+-- XXX Author:
+-- XXX Maintainer:
+Synopsis: XXX
+Description:
+ XXX
+build-type: Simple
+cabal-version: >=1.2
+
+Flag base3
+ Description: Choose the new smaller, split-up base package.
+
+Executable ghc-pwd
+ Main-Is: ghc-pwd.hs
+ if flag(base3)
+ Build-Depends: base >= 3 && < 5,
+ directory >= 1 && < 1.1
+ else
+ Build-Depends: base < 3
+
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
+