Commit 00dd16d7 authored by ssrq's avatar ssrq

[__sensible_editor] List available editors when an incorrect one is provided

parent f782a854
...@@ -28,7 +28,10 @@ die() { ...@@ -28,7 +28,10 @@ die() {
} }
editor_missing() { die "Editor '$1' is missing on the target system."; } editor_missing() { die "Editor '$1' is missing on the target system."; }
editor_no_alternative() { die "Editor '$1' is not in the alternatives list of the target system."; } editor_no_alternative() {
die "Editor '$1' is not in the alternatives list of the target system." \
"$(test "${editors}" && echo "\nPlease choose one of:\n\n${editors}")"
}
case $("${__explorer}/os") case $("${__explorer}/os")
...@@ -63,7 +66,7 @@ in ...@@ -63,7 +66,7 @@ in
esac esac
if $has_alternatives && test "$(echo "${editors}" | wc -l)" -gt 0 if $has_alternatives && test -n "${editors}"
then then
IFS=' IFS='
' '
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment