parent
1828ff5697
commit
7375316478
|
@ -49,24 +49,30 @@
|
|||
(if default-yes? "Y" "y")
|
||||
(if default-yes? "n" "N"))
|
||||
(flush-output)
|
||||
(match (string-trim (read-line (current-input-port) 'any))
|
||||
[(or "y" "Y")
|
||||
'yes]
|
||||
[(or "n" "N")
|
||||
'no]
|
||||
[(or "a" "A")
|
||||
'always-yes]
|
||||
[(or "c" "C")
|
||||
(define reply (read-line (current-input-port) 'any))
|
||||
(cond
|
||||
[(eof-object? reply)
|
||||
(eprintf "\nTreating end-of-file input as \"cancel\".\n")
|
||||
'cancel]
|
||||
[""
|
||||
(if default-yes? 'yes 'no)]
|
||||
[x
|
||||
(eprintf "Invalid answer: ~a\n" x)
|
||||
(eprintf " Answer ~a`y' or `Y' for \"yes\", ~a`n' or `N' for \"no\", or\n"
|
||||
(if default-yes? "nothing or " "")
|
||||
(if default-yes? "" "nothing or "))
|
||||
(eprintf " `a' or `A' for \"yes for all\", or `c' or `C' for \"cancel\".\n")
|
||||
(loop)])))
|
||||
[else
|
||||
(match (string-trim reply)
|
||||
[(or "y" "Y")
|
||||
'yes]
|
||||
[(or "n" "N")
|
||||
'no]
|
||||
[(or "a" "A")
|
||||
'always-yes]
|
||||
[(or "c" "C")
|
||||
'cancel]
|
||||
[""
|
||||
(if default-yes? 'yes 'no)]
|
||||
[x
|
||||
(eprintf "Invalid answer: ~a\n" x)
|
||||
(eprintf " Answer ~a`y' or `Y' for \"yes\", ~a`n' or `N' for \"no\", or\n"
|
||||
(if default-yes? "nothing or " "")
|
||||
(if default-yes? "" "nothing or "))
|
||||
(eprintf " `a' or `A' for \"yes for all\", or `c' or `C' for \"cancel\".\n")
|
||||
(loop)])])))
|
||||
|
||||
|
||||
(define (dry-run-explain dry-run?)
|
||||
|
|
Loading…
Reference in New Issue
Block a user