summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDieter Plaetinck <dieter@plaetinck.be>2009-02-14 15:03:06 +0100
committerDieter Plaetinck <dieter@plaetinck.be>2009-02-14 15:03:06 +0100
commitd860efe097ff76c511b5fdf53dc2c90752e2b85b (patch)
tree4e700477d4e76b1e9978fb7825dbd03772dc5c8d
parent8bec371c9fbc6bb8c7d1efed8a8538ea2c842a3d (diff)
fix FS#13045 - add joe editor
-rw-r--r--src/core/libs/lib-ui-interactive.sh18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/core/libs/lib-ui-interactive.sh b/src/core/libs/lib-ui-interactive.sh
index 3e61c2a..851e990 100644
--- a/src/core/libs/lib-ui-interactive.sh
+++ b/src/core/libs/lib-ui-interactive.sh
@@ -876,17 +876,21 @@ interactive_select_mirror() {
echo "Using mirror: $var_SYNC_URL" >$LOG
}
-# geteditor(). taken from original setup code.
+# geteditor().
# prompts the user to choose an editor
# sets EDITOR global variable
#
interactive_get_editor() {
- ask_option no "Text editor selection" "Select a Text Editor to Use" \
- "1" "nano (easier)" \
- "2" "vi"
+ unset EDITOR_OPTS
+ which nano &>/dev/null && EDITOR_OPTS+=("nano" "nano (easier)")
+ which joe &>/dev/null && EDITOR_OPTS+=("joe" "joe's editor")
+ which vi &>/dev/null && EDITOR_OPTS+=("vi" "vi (advanced)")
+ ask_option no "Text editor selection" "Select a Text Editor to Use" "${EDITOR_OPTS[@]}"
+ #TODO: this code could be a little bit cleaner.
case $ANSWER_OPTION in
- "1") EDITOR="nano" ;;
- "2") EDITOR="vi" ;;
- *) EDITOR="nano" ;;
+ "nano") EDITOR="nano" ;;
+ "joe") EDITOR="joe" ;;
+ "vi") EDITOR="vi" ;;
+ *) EDITOR="nano" ;;
esac
}