From 7cf63355fdb98b19a984d80c77bcb7be8d23102c Mon Sep 17 00:00:00 2001 From: Jephte CLAIN Date: Sun, 7 Dec 2014 09:01:35 +0400 Subject: [PATCH] =?UTF-8?q?am=C3=A9liorer=20ergnonomie.=20en=20particulier?= =?UTF-8?q?,=20ne=20pas=20afficher=20la=20valeur=20par=20d=C3=A9faut=20d'u?= =?UTF-8?q?n=20mot=20de=20passe?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/ulib/base | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/lib/ulib/base b/lib/ulib/base index 27df804..0e0d3bd 100644 --- a/lib/ulib/base +++ b/lib/ulib/base @@ -3123,15 +3123,15 @@ function read_value() { # est vide, afficher un message d'erreur et retourner faux # read_password() est comme read_value(), mais la valeur saisie n'est pas # affichée, ce qui la rend appropriée pour la lecture d'un mot de passe. - local -a __rv_opts + local -a __rv_opts __rv_readline=1 __rv_showdef=1 __rv_nl= __rv_opts=() + [ -n "$UTOOLS_NO_READLINE" ] && __rv_readline= __rv_read "$@" } function read_password() { - local -a __rv_opts + local -a __rv_opts __rv_readline= __rv_showdef= __rv_nl=1 __rv_opts=(-s) __rv_read "$@" - echo "" } function __rv_read() { local __rv_int=1 @@ -3162,13 +3162,20 @@ function __rv_read() { else tooenc_ "Entrez la valeur" "$UTF8" 1>&2 fi - if [ -n "$UTOOLS_NO_READLINE" ]; then - [ -n "$__rv_d" ] && tooenc_ " [$__rv_d]" 1>&2 - tooenc_ ": " "$UTF8" 1>&2 - uread "${__rv_opts[@]}" __rv_r - else + if [ -n "$__rv_readline" ]; then tooenc_ ": " "$UTF8" 1>&2 uread -e ${__rv_d:+-i"$__rv_d"} "${__rv_opts[@]}" __rv_r + else + if [ -n "$__rv_d" ]; then + if [ -n "$__rv_showdef" ]; then + tooenc_ " [$__rv_d]" 1>&2 + else + tooenc_ " [****]" 1>&2 + fi + fi + tooenc_ ": " "$UTF8" 1>&2 + uread "${__rv_opts[@]}" __rv_r + [ -n "$__rv_nl" ] && echo fi __rv_r="${__rv_r:-$__rv_d}" if [ -n "$__rv_r" ] || ! is_yes "$__rv_re"; then