Skip to content
This repository was archived by the owner on Oct 7, 2020. It is now read-only.

Commit c9c519a

Browse files
committed
Generate build target help message
1 parent 903d1f9 commit c9c519a

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

install.hs

+12-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ import System.Info ( os
2323
, arch
2424
)
2525

26-
import Data.List ( dropWhileEnd )
26+
import Data.List ( dropWhileEnd
27+
, intersperse
28+
)
2729
import Data.Char ( isSpace )
2830

2931
type VersionNumber = String
@@ -211,10 +213,18 @@ helpMessage = do
211213
hieTarget version =
212214
("hie-" ++ version, "Builds hie for GHC version " ++ version ++ " only")
213215

216+
allVersionMessage :: String
217+
allVersionMessage =
218+
let msg = intersperse ", " hieVersions
219+
lastVersion = last msg
220+
in concat $ (init $ init msg) ++ [" and ", lastVersion]
221+
214222
-- All targets with their respective help message.
215223
targets =
216224
[ ( "build"
217-
, "Builds hie for all supported GHC versions (8.2.1, 8.2.2, 8.4.2, 8.4.3, 8.4.4, 8.6.1, 8.6.2 and 8.6.3)"
225+
, "Builds hie for all supported GHC versions ("
226+
++ allVersionMessage
227+
++ ")"
218228
)
219229
, ( "build-all"
220230
, "Builds hie and hoogle databases for all supported GHC versions"

0 commit comments

Comments
 (0)