forked from commercialhaskell/stack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGhcBuildParser.hs
More file actions
26 lines (24 loc) · 854 Bytes
/
GhcBuildParser.hs
File metadata and controls
26 lines (24 loc) · 854 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
{-# LANGUAGE NoImplicitPrelude #-}
module Stack.Options.GhcBuildParser where
import Options.Applicative
import Options.Applicative.Types
import Stack.Options.Utils
import Stack.Prelude
import Stack.Types.CompilerBuild
-- | GHC build parser
ghcBuildParser :: Bool -> Parser CompilerBuild
ghcBuildParser hide =
option
readGHCBuild
(long "ghc-build" <> metavar "BUILD" <>
completeWith ["standard", "gmp4", "nopie", "tinfo6", "tinfo6-nopie", "ncurses6", "integersimple"] <>
help
"Specialized GHC build, e.g. 'gmp4' or 'standard' (usually auto-detected)" <>
hideMods hide
)
where
readGHCBuild = do
s <- readerAsk
case parseCompilerBuild s of
Left e -> readerError (show e)
Right v -> return v