Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/juhp/simple-prompt


https://github.com/juhp/simple-prompt

Last synced: 8 days ago
JSON representation

Awesome Lists containing this project

README

        

# simple-prompt

A simple commandline text prompt library for user input.

The `SimplePrompt` module provides:

- `prompt`: returns a string
- `promptNonEmpty` prompts for non-empty string
- `promptInitial` with pre-filled initial input
- `promptPassword` prompts for password
- `promptChar` prompts for a character
- `promptKeyPress` waits for a key press
- `promptEnter` waits for Enter key
- `yesNo` expects y/n answer
- `yesNoDefault` [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`.