Commit 3bbb7b02 authored by ssrq's avatar ssrq

[__sensible_editor] Allow to omit the --editor parameter if --state is absent

parent 00dd16d7
......@@ -33,6 +33,9 @@ editor_no_alternative() {
"$(test "${editors}" && echo "\nPlease choose one of:\n\n${editors}")"
# No need to check for the path if the file is supposed to be removed.
test "$(cat "${__object}/parameter/state")" != 'absent' || exit 0
case $("${__explorer}/os")
......@@ -50,7 +53,9 @@ in
editor=$(cat "${__object}/parameter/editor")
# Read --editor parameter and check its value since it is "optional"
editor=$(cat "${__object}/parameter/editor" 2>/dev/null) || true
test -n "${editor}" || die 'Please provide an --editor to configure.'
case $editor
......@@ -18,6 +18,8 @@ editor
Name or path of the editor to be selected.
On systems other than Debian derivatives an absolute path is required.
It is permissible to omit this parameter if --state is absent.
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