add default answer and add compliance with shellcheck

Cette révision appartient à :
Simon Vieille 2019-07-31 20:49:59 +02:00
Parent faeb8492b7
révision 4398347162
Signé par: deblan
ID de la clé GPG: 03383D15A1D31745
3 fichiers modifiés avec 6 ajouts et 4 suppressions

Voir le fichier

@ -99,7 +99,7 @@ chmod 600 "$TMP_FILE"
whiptail --textbox "$TMP_FILE" 25 80
rm "$TMP_FILE"
CONTINUE="$(form_yes_no -t "$TITLE" -l "Do you confirm?")"
CONTINUE="$(form_yes_no -t "$TITLE" -l "Do you confirm?" -n)"
if [ "$CONTINUE" = "no" ]; then
printf "Aborded!\\n"

Voir le fichier

@ -5,13 +5,15 @@ LABEL=
ERROR=0
HEIGHT=8
WIDTH=50
PARAMS=
while getopts "t:l:d:h:w:r" option; do
while getopts "t:l:d:h:w:rn" option; do
case "$option" in
l) LABEL="$OPTARG";;
t) TITLE="$OPTARG";;
h) HEIGHT="$OPTARG";;
w) WIDTH="$OPTARG";;
n) PARAMS="$PARAMS --defaultno";;
:) ERROR=1;;
?) ERROR=1;;
esac
@ -21,7 +23,7 @@ if [ $ERROR -eq 1 ]; then
exit 1
fi
if (whiptail --title "$TITLE" --yesno "$LABEL" $HEIGHT $WIDTH 3>&1 1>&2 2>&3) then
if (whiptail --title "$TITLE" --yesno "$LABEL" $PARAMS $HEIGHT $WIDTH 3>&1 1>&2 2>&3) then
printf "yes"
else
printf "no"

Voir le fichier

@ -2,4 +2,4 @@
. ./etc/config
$PHP_BIN -dvariables_order=EGPCS ./share/bin/twigc -E -d ./src/templates/ < "src/templates/${1}.twig"
"$PHP_BIN" -dvariables_order=EGPCS ./share/bin/twigc -E -d ./src/templates/ < "src/templates/${1}.twig"