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