iris-0.1.0.0: Haskell CLI framework
Copyright(c) 2022 Dmitrii Kovanikov
LicenseMPL-2.0
MaintainerDmitrii Kovanikov <kovanikov@gmail.com>
StabilityExperimental
PortabilityPortable
Safe HaskellSafe-Inferred
LanguageHaskell2010

Iris.Cli.Interactive

Description

Interactive mode datatype and CLI parser.

Since: 0.0.0.0

Synopsis

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

Instances details
Show InteractiveMode Source #

Since: 0.0.0.0

Instance details

Defined in Iris.Cli.Interactive

Eq InteractiveMode Source #

Since: 0.0.0.0

Instance details

Defined in Iris.Cli.Interactive

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