{-# LANGUAGE NoImplicitPrelude #-}
module Stack.Options.Utils
( GlobalOptsContext (..)
, hideMods
) where
import Options.Applicative ( Mod, hidden, idm, internal )
import Stack.Prelude
hideMods :: Bool -> Mod f a
hideMods :: forall (f :: * -> *) a. Bool -> Mod f a
hideMods Bool
hide = if Bool
hide then Mod f a
forall (f :: * -> *) a. Mod f a
internal Mod f a -> Mod f a -> Mod f a
forall a. Semigroup a => a -> a -> a
<> Mod f a
forall (f :: * -> *) a. Mod f a
hidden else Mod f a
forall m. Monoid m => m
idm
data GlobalOptsContext
= OuterGlobalOpts
| OtherCmdGlobalOpts
| BuildCmdGlobalOpts
| GhciCmdGlobalOpts
deriving (GlobalOptsContext -> GlobalOptsContext -> Bool
(GlobalOptsContext -> GlobalOptsContext -> Bool)
-> (GlobalOptsContext -> GlobalOptsContext -> Bool)
-> Eq GlobalOptsContext
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: GlobalOptsContext -> GlobalOptsContext -> Bool
== :: GlobalOptsContext -> GlobalOptsContext -> Bool
$c/= :: GlobalOptsContext -> GlobalOptsContext -> Bool
/= :: GlobalOptsContext -> GlobalOptsContext -> Bool
Eq, Int -> GlobalOptsContext -> ShowS
[GlobalOptsContext] -> ShowS
GlobalOptsContext -> String
(Int -> GlobalOptsContext -> ShowS)
-> (GlobalOptsContext -> String)
-> ([GlobalOptsContext] -> ShowS)
-> Show GlobalOptsContext
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> GlobalOptsContext -> ShowS
showsPrec :: Int -> GlobalOptsContext -> ShowS
$cshow :: GlobalOptsContext -> String
show :: GlobalOptsContext -> String
$cshowList :: [GlobalOptsContext] -> ShowS
showList :: [GlobalOptsContext] -> ShowS
Show)