aboutsummaryrefslogtreecommitdiff
path: root/CabalHelper
diff options
context:
space:
mode:
authorDaniel Gröber <dxld@darkboxed.org>2015-08-28 07:43:21 +0200
committerDaniel Gröber <dxld@darkboxed.org>2015-08-28 07:43:21 +0200
commit7c4a58f0b6bbafc655489c3c894acc666226131d (patch)
tree67bbe09ad32d9409072b545df51baceef17ab360 /CabalHelper
parentee950d4b1df668ff5c4b61649e5ae3c18a54aa40 (diff)
Update `Usage`
Diffstat (limited to 'CabalHelper')
-rw-r--r--CabalHelper/Common.hs14
-rw-r--r--CabalHelper/Main.hs31
-rw-r--r--CabalHelper/Wrapper.hs2
3 files changed, 17 insertions, 30 deletions
diff --git a/CabalHelper/Common.hs b/CabalHelper/Common.hs
index cf606d8..3a6d4b6 100644
--- a/CabalHelper/Common.hs
+++ b/CabalHelper/Common.hs
@@ -50,20 +50,6 @@ errMsg str = do
prog <- getProgName
hPutStrLn stderr $ prog ++ ": " ++ str
-align :: String -> String -> String -> String
-align n an str = let
- h:rest = lines str
- [hm] = match n h
- rest' = [ move (hm - rm) r | r <- rest, rm <- match an r]
- in
- unlines (h:rest')
- where
- match p str' = maybeToList $
- fst <$> find ((p `isPrefixOf`) . snd) ([0..] `zip` tails str')
- move i str' | i > 0 = replicate i ' ' ++ str'
- move i str' = drop i str'
-
-
-- | @getCabalConfigHeader "dist/setup-config"@ returns the cabal version and
-- compiler version
getCabalConfigHeader :: FilePath -> IO (Maybe (Version, (ByteString, Version)))
diff --git a/CabalHelper/Main.hs b/CabalHelper/Main.hs
index 7a86bdb..9dca50d 100644
--- a/CabalHelper/Main.hs
+++ b/CabalHelper/Main.hs
@@ -86,23 +86,24 @@ import CabalHelper.Types hiding (Options(..))
usage = do
prog <- getProgName
- hPutStr stderr $ align "(" "|" ("Usage: " ++ prog ++ " " ++ usageMsg)
+ hPutStr stderr $ "Usage: " ++ prog ++ " " ++ usageMsg
where
usageMsg = ""
- ++"DIST_DIR ( version\n"
- ++" | print-lbi [--human]\n"
- ++" | write-autogen-files\n"
- ++" | compiler-version\n"
- ++" | ghc-options [--with-inplace]\n"
- ++" | ghc-src-options [--with-inplace]\n"
- ++" | ghc-pkg-options [--with-inplace]\n"
- ++" | ghc-merged-pkg-options [--with-inplace]\n"
- ++" | ghc-lang-options [--with-inplace]\n"
- ++" | package-db-stack\n"
- ++" | entrypoints\n"
- ++" | source-dirs\n"
- ++" | licenses\n"
- ++" ) ...\n"
+ ++"PROJ_DIR DIST_DIR [--with-* ...] (\n"
+ ++" version\n"
+ ++" | print-lbi [--human]\n"
+ ++" | write-autogen-files\n"
+ ++" | compiler-version\n"
+ ++" | ghc-options [--with-inplace]\n"
+ ++" | ghc-src-options [--with-inplace]\n"
+ ++" | ghc-pkg-options [--with-inplace]\n"
+ ++" | ghc-merged-pkg-options [--with-inplace]\n"
+ ++" | ghc-lang-options [--with-inplace]\n"
+ ++" | package-db-stack\n"
+ ++" | entrypoints\n"
+ ++" | source-dirs\n"
+ ++" | licenses\n"
+ ++" ) ...\n"
commands :: [String]
commands = [ "print-bli"
diff --git a/CabalHelper/Wrapper.hs b/CabalHelper/Wrapper.hs
index c0908dc..a05426a 100644
--- a/CabalHelper/Wrapper.hs
+++ b/CabalHelper/Wrapper.hs
@@ -45,7 +45,7 @@ import CabalHelper.Types
usage :: IO ()
usage = do
prog <- getProgName
- hPutStr stderr $ align "(" "|" ("Usage: " ++ prog ++ " " ++ usageMsg)
+ hPutStr stderr $ "Usage: " ++ prog ++ " " ++ usageMsg
where
usageMsg = "\
\( print-appdatadir\n\