allow confirmation with a single keystroke
This commit is contained in:
parent
e2c1453dcd
commit
0f83374060
|
@ -39,9 +39,9 @@ import System.Console.HCL
|
||||||
( Request
|
( Request
|
||||||
, prompt
|
, prompt
|
||||||
, reqAgree
|
, reqAgree
|
||||||
|
, reqChar
|
||||||
, reqIf
|
, reqIf
|
||||||
, reqMenu
|
, reqMenu
|
||||||
, reqResp
|
|
||||||
, required
|
, required
|
||||||
, runRequest
|
, runRequest
|
||||||
)
|
)
|
||||||
|
@ -87,6 +87,6 @@ tryReq :: Request a -> S.StateT s IO (Maybe a)
|
||||||
tryReq = lift . runRequest
|
tryReq = lift . runRequest
|
||||||
|
|
||||||
confirm :: String -> Request Bool
|
confirm :: String -> Request Bool
|
||||||
confirm x = required $ prompt (x ++ " (y/n): ") $ reqAgree Nothing reqResp
|
confirm x = prompt (x ++ " (y/n): ") $ reqAgree Nothing $ fmap return reqChar
|
||||||
|
|
||||||
--jl
|
--jl
|
||||||
|
|
Loading…
Reference in New Issue
Block a user