simple-prompt-0.2.3: Simple commandline text prompt functions
Safe HaskellSafe-Inferred
LanguageHaskell2010

SimplePrompt

Synopsis

Documentation

prompt :: (MonadIO m, MonadMask m) => String -> m String Source #

prompt which drops buffered input (using clearedInput)

Ignores buffered input lines (ie if input line gotten in under 5ms)

promptInitial :: (MonadIO m, MonadMask m) => String -> String -> m String Source #

reads string with initial input (using clearedInput)

promptBuffered :: (MonadIO m, MonadMask m) => String -> m String Source #

reads string with buffering

promptNonEmpty :: (MonadIO m, MonadMask m) => String -> m String Source #

reads non-empty string (using nonEmptyInput)

promptChar :: (MonadIO m, MonadMask m) => String -> m Char Source #

prompt for a printable character

promptKeyPress :: (MonadIO m, MonadMask m) => String -> m Bool Source #

prompt for key press (returns False if Ctrl-d or EOF)

promptEnter :: (MonadIO m, MonadMask m) => String -> m () Source #

prompt for Enter key

promptPassword :: (MonadIO m, MonadMask m) => String -> m String Source #

prompt for a password

yesNo :: (MonadIO m, MonadMask m) => String -> m Bool Source #

Yes-No prompt (accepts only {y,n,yes,no} case-insensitive)

yesNoDefault :: (MonadIO m, MonadMask m) => Bool -> String -> m Bool Source #

Yes-No prompt with default (uses clearedInput)