Allow cancelling dialogues using CTRL+C
This commit is contained in:
parent
9540680341
commit
33758298cf
|
@ -29,6 +29,7 @@ function chooseDisk -a outFile message
|
||||||
end
|
end
|
||||||
|
|
||||||
read -lP "Your choice: " choice
|
read -lP "Your choice: " choice
|
||||||
|
or exit 1
|
||||||
|
|
||||||
if [ "$choice" -ge 1 ] && [ "$choice" -le "$diskCount" ]
|
if [ "$choice" -ge 1 ] && [ "$choice" -le "$diskCount" ]
|
||||||
set -l disk (string split -n " " "$disks[$(math "$choice" + 1)]")
|
set -l disk (string split -n " " "$disks[$(math "$choice" + 1)]")
|
||||||
|
|
|
@ -4,6 +4,7 @@ function confirm -a message default
|
||||||
|
|
||||||
while true
|
while true
|
||||||
read -l value -P "$message $options "
|
read -l value -P "$message $options "
|
||||||
|
or exit 1
|
||||||
set value (string lower "$value")
|
set value (string lower "$value")
|
||||||
|
|
||||||
if [ -z "$value" ]
|
if [ -z "$value" ]
|
||||||
|
|
Loading…
Reference in a new issue