Revert printf syntax changes from 8d0bc55

These changes break the TUI formatting. Strings passed to printf may intentionally have newlines.
This commit is contained in:
the-sane
2025-10-06 13:48:50 -04:00
parent 3466d8794a
commit ad786f6df3

View File

@@ -358,7 +358,7 @@ message() {
"info")
# info message
# call format: message info "text to display"
printf "\n%s\n\n" "$2"
printf "\n$2\n\n"
if [ "$cmd_line" != "true" ]; then
# Don't pause if we've been invoked via command line arguments
read -n 1 -s -p "Press any key..."
@@ -367,19 +367,19 @@ message() {
"warning")
# warning message
# call format: message warning "text to display"
printf "\n%s\n\n" "$2"
printf "\n$2\n\n"
read -n 1 -s -p "Press any key..."
;;
"error")
# error message. Does not clear the screen
# call format: message error "text to display"
printf "\n%s\n\n" "$2"
printf "\n$2\n\n"
read -n 1 -s -p "Press any key..."
;;
"question")
# question
# call format: if message question "question to ask?"; then...
printf "\n%s\n" "$2"
printf "\n$2\n"
while read -p "[y/n]: " yn; do
case "$yn" in
[Yy]*)
@@ -397,7 +397,7 @@ message() {
"options")
# Choose from two options
# call format: if message options left_button_name right_button_name "which one do you want?"; then...
printf "\n%s\n1: %s\n2: %s\n" "$4" "$3" "$2"
printf "\n$4\n1: $3\n2: $2\n"
while read -p "[1/2]: " option; do
case "$option" in
1*)
@@ -585,7 +585,7 @@ menu() {
else
# Use a text menu if Zenity is not available
clear
printf "\n%s\n\n" "$menu_text_terminal"
printf "\n$menu_text_terminal\n\n"
PS3="Enter selection number: "
select choice in "${menu_options[@]}"