| Copyright | (c) 2022 Dmitrii Kovanikov |
|---|---|
| License | MPL-2.0 |
| Maintainer | Dmitrii Kovanikov <kovanikov@gmail.com> |
| Stability | Experimental |
| Portability | Portable |
| Safe Haskell | Safe-Inferred |
| Language | Haskell2010 |
Iris.Cli.Interactive
Description
Interactive mode datatype and CLI parser.
Since: 0.0.0.0
Documentation
data InteractiveMode Source #
Datatype for specifying if the terminal is interactive.
Since: 0.0.0.0
Constructors
| Interactive | Since: 0.0.0.0 |
| NonInteractive | Since: 0.0.0.0 |
Instances
| Show InteractiveMode Source # | Since: 0.0.0.0 |
Defined in Iris.Cli.Interactive Methods showsPrec :: Int -> InteractiveMode -> ShowS # show :: InteractiveMode -> String # showList :: [InteractiveMode] -> ShowS # | |
| Eq InteractiveMode Source # | Since: 0.0.0.0 |
Defined in Iris.Cli.Interactive Methods (==) :: InteractiveMode -> InteractiveMode -> Bool # (/=) :: InteractiveMode -> InteractiveMode -> Bool # | |
interactiveModeP :: Parser InteractiveMode Source #
A CLI option parser for switching to non-interactive mode
if the --no-input flag is passed.
Since: 0.0.0.0
handleInteractiveMode :: InteractiveMode -> IO InteractiveMode Source #
Forces non interactive mode when the terminal is not interactive
Use this function to check whether you can get input from the terminal:
handleInteractiveMode requestedInteractiveMode
If the terminal is non interactive i.e. the program is run in a pipe, interactive mode is set to false no matter what
Since: 0.1.0.0