mu-wizard

shell script to easily configure mu4e accounts on Emacs
git clone git://git.ckyln.com/mu-wizard
Log | Files | Refs | LICENSE

commit 96c0e7ac86d9d0546fbe11f40ac261fc854107aa
parent bda0baae140b6611aca333632b095eda62b80555
Author: Cem Keylan <cem@ckyln.com>
Date:   Sat,  6 Feb 2021 17:56:28 +0300

yesno(): Add noconfirm variable

Diffstat:
Mbin/muw | 7++++++-
1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/bin/muw b/bin/muw @@ -40,7 +40,12 @@ getbut() { yesno() { # Function to ask the user yes/no questions. Returns 0 if the button # received is Y/y, Returns 1 if the button received is N/n, and returns - # 2 if any other button is received. + # 2 if any other button is received. If the noconfirm option is set from + # the options, do not ask anything. + # + # The 'noconfirm' variable is declared and assigned by the option parser. + # shellcheck disable=2154 + [ "$noconfirm" ] && return 0 printf '%s\n' "$@"; printf 'y/n: ' ans=$(getbut) printf '%s\n' "$ans" >&2