summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDieter Plaetinck <dieter@plaetinck.be>2008-12-14 20:21:02 +0100
committerDieter Plaetinck <dieter@plaetinck.be>2008-12-14 20:21:02 +0100
commit809ebc2f51b548f0fc09d8a12cd0df9cf3f9b65e (patch)
tree4999226252c77b8d64506e5320b01a2280f87c27 /src
parentd2d7208937561adbc83025af1fc4ec98f39e7f9d (diff)
fixes for ask_option
Diffstat (limited to 'src')
-rw-r--r--src/core/libs/lib-ui.sh11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/core/libs/lib-ui.sh b/src/core/libs/lib-ui.sh
index 3f64ee6..f7fd42c 100644
--- a/src/core/libs/lib-ui.sh
+++ b/src/core/libs/lib-ui.sh
@@ -346,8 +346,9 @@ _dia_ask_option ()
[ -z "$5" ] && debug "_dia_ask_option args: $@" && die_error "ask_option makes only sense if you specify at least one option (with tag and name)" #nothing wrong with only 1 option. it still shows useful info to the user
DIA_MENU_TITLE=$2
+ EXTRA_INFO=$3
shift 3
- _dia_DIALOG $DEFAULT --colors --title " $DIA_MENU_TITLE " --menu "$DIA_MENU_TEXT $3" 20 80 16 "$@" 2>$ANSWER
+ _dia_DIALOG $DEFAULT --colors --title " $DIA_MENU_TITLE " --menu "$DIA_MENU_TEXT $EXTRA_INFO" 20 80 16 "$@" 2>$ANSWER
ret=$?
ANSWER_OPTION=`cat $ANSWER`
debug "dia_ask_option: User choose $ANSWER_OPTION ($2)"
@@ -481,10 +482,12 @@ _cli_ask_option ()
# $3 is optional more info
[ -z "$5" ] && debug "_dia_ask_option args: $@" && die_error "ask_option makes only sense if you specify at least one option (with tag and name)" #nothing wrong with only 1 option. it still shows useful info to the user
+ MENU_TITLE=$2
+ EXTRA_INFO=$3
shift 3
- echo "$2"
- [ -n "$3" ] && echo "$3"
+ echo "$MENU_TITLE"
+ [ -n "$EXTRA_INFO" ] && echo "$EXTRA_INFO"
while [ -n "$1" ]
do
echo "$1 ] $2"
@@ -495,7 +498,7 @@ _cli_ask_option ()
[ -z "$DEFAULT" ] && echo -n " > "
read ANSWER_OPTION
[ -z "$ANSWER_OPTION" -a -n "$DEFAULT" ] && ANSWER_OPTION="$DEFAULT"
- debug "cli_ask_option: User choose $ANSWER_OPTION ($2)"
+ debug "cli_ask_option: User choose $ANSWER_OPTION ($MENU_TITLE)"
[ "$ANSWER_OPTION" = CANCEL ] && return 1
return 0
}