module Iris.Cli.Interactive
( InteractiveMode (..)
, interactiveModeP
) where
import Options.Applicative ( (<|>) )
import qualified Options.Applicative as Opt
data InteractiveMode
= Interactive
| NonInteractive
deriving stock
( Int -> InteractiveMode -> ShowS
[InteractiveMode] -> ShowS
InteractiveMode -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InteractiveMode] -> ShowS
$cshowList :: [InteractiveMode] -> ShowS
show :: InteractiveMode -> String
$cshow :: InteractiveMode -> String
showsPrec :: Int -> InteractiveMode -> ShowS
$cshowsPrec :: Int -> InteractiveMode -> ShowS
Show
, InteractiveMode -> InteractiveMode -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InteractiveMode -> InteractiveMode -> Bool
$c/= :: InteractiveMode -> InteractiveMode -> Bool
== :: InteractiveMode -> InteractiveMode -> Bool
$c== :: InteractiveMode -> InteractiveMode -> Bool
Eq
)
interactiveModeP :: Opt.Parser InteractiveMode
interactiveModeP :: Parser InteractiveMode
interactiveModeP = Parser InteractiveMode
nonInteractiveP forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
<|> forall (f :: * -> *) a. Applicative f => a -> f a
pure InteractiveMode
Interactive
where
nonInteractiveP :: Opt.Parser InteractiveMode
nonInteractiveP :: Parser InteractiveMode
nonInteractiveP = forall a. a -> Mod FlagFields a -> Parser a
Opt.flag' InteractiveMode
NonInteractive forall a b. (a -> b) -> a -> b
$ forall a. Monoid a => [a] -> a
mconcat
[ forall (f :: * -> *) a. HasName f => String -> Mod f a
Opt.long String
"no-input"
, forall (f :: * -> *) a. String -> Mod f a
Opt.help String
"Enter the terminal in non-interactive mode"
]