forked from commercialhaskell/stack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGhcVariantParser.hs
More file actions
25 lines (23 loc) · 771 Bytes
/
GhcVariantParser.hs
File metadata and controls
25 lines (23 loc) · 771 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
{-# LANGUAGE NoImplicitPrelude #-}
module Stack.Options.GhcVariantParser where
import Options.Applicative
import Options.Applicative.Types (readerAsk)
import Stack.Prelude
import Stack.Options.Utils
import Stack.Types.Config
-- | GHC variant parser
ghcVariantParser :: Bool -> Parser GHCVariant
ghcVariantParser hide =
option
readGHCVariant
(long "ghc-variant" <> metavar "VARIANT" <>
help
"Specialized GHC variant, e.g. integersimple (incompatible with --system-ghc)" <>
hideMods hide
)
where
readGHCVariant = do
s <- readerAsk
case parseGHCVariant s of
Left e -> readerError (show e)
Right v -> return v