Description
Simple commandline text prompt functions.
Description
The library provides prompt functions for reading user input: for example prompt
returns the input given, promptEnter
expects only Enter, and yesNo
asks for confirmation.
README.md
simple-prompt
A simple commandline text prompt library for user input.
The SimplePrompt
module provides:
prompt
: returns a stringpromptNonEmpty
prompts for non-empty stringpromptInitial
with pre-filled initial inputpromptPassword
prompts for passwordpromptChar
prompts for a characterpromptKeyPress
waits for a key presspromptEnter
waits for Enter keyyesNo
expects y/n answeryesNoDefault
[y/N] or [Y/n]
It uses haskeline to read the input.
The SimplePrompt.Internal
module provides lower-level access to functional haskeline InputT monad transformer-based prompt functions:
runPrompt
,getPrompt*
untilInput
,mapInput
,clearedInput
,nonEmptyInput
.