cabal-install-3.10.1.0: The command-line interface for Cabal and Hackage.
Copyright(c) Brent Yorgey 2009
LicenseBSD-like
Maintainercabal-devel@haskell.org
Stabilityprovisional
Portabilityportable
Safe HaskellSafe-Inferred
LanguageHaskell2010

Distribution.Client.Init.Prompt

Description

User prompt utility functions for use by the 'cabal init' command.

Synopsis

Documentation

prompt :: (Interactive m, Parsec t, Pretty t) => String -> DefaultPrompt t -> m t Source #

Create a prompt with optional default value that returns a value of some Text instance.

promptYesNo Source #

Arguments

:: Interactive m 
=> String

prompt message

-> DefaultPrompt Bool

optional default value

-> m Bool 

Create a yes/no prompt with optional default value.

promptStr :: Interactive m => String -> DefaultPrompt String -> m String Source #

Create a prompt with optional default value that returns a String.

promptList Source #

Arguments

:: Interactive m 
=> String

prompt

-> [String]

choices

-> DefaultPrompt String

optional default value

-> Maybe (String -> String)

modify the default value to present in-prompt e.g. empty string maps to "(none)", but only in the prompt.

-> Bool

whether to allow an other option

-> m String 

Create a prompt from a list of strings