Fix a few old lingering printf syntax errors

This commit is contained in:
the-sane
2025-08-26 11:37:46 -04:00
parent 01d63f7013
commit 8d0bc550a6

View File

@@ -353,7 +353,7 @@ message() {
"info") "info")
# info message # info message
# call format: message info "text to display" # call format: message info "text to display"
printf "\n$2\n\n" printf "\n%s\n\n" "$2"
if [ "$cmd_line" != "true" ]; then if [ "$cmd_line" != "true" ]; then
# Don't pause if we've been invoked via command line arguments # Don't pause if we've been invoked via command line arguments
read -n 1 -s -p "Press any key..." read -n 1 -s -p "Press any key..."
@@ -362,19 +362,19 @@ message() {
"warning") "warning")
# warning message # warning message
# call format: message warning "text to display" # call format: message warning "text to display"
printf "\n$2\n\n" printf "\n%s\n\n" "$2"
read -n 1 -s -p "Press any key..." read -n 1 -s -p "Press any key..."
;; ;;
"error") "error")
# error message. Does not clear the screen # error message. Does not clear the screen
# call format: message error "text to display" # call format: message error "text to display"
printf "\n$2\n\n" printf "\n%s\n\n" "$2"
read -n 1 -s -p "Press any key..." read -n 1 -s -p "Press any key..."
;; ;;
"question") "question")
# question # question
# call format: if message question "question to ask?"; then... # call format: if message question "question to ask?"; then...
printf "\n$2\n" printf "\n%s\n" "$2"
while read -p "[y/n]: " yn; do while read -p "[y/n]: " yn; do
case "$yn" in case "$yn" in
[Yy]*) [Yy]*)
@@ -392,7 +392,7 @@ message() {
"options") "options")
# Choose from two options # Choose from two options
# call format: if message options left_button_name right_button_name "which one do you want?"; then... # call format: if message options left_button_name right_button_name "which one do you want?"; then...
printf "\n$4\n1: $3\n2: $2\n" printf "\n%s\n1: %s\n2: %s\n" "$4" "$3" "$2"
while read -p "[1/2]: " option; do while read -p "[1/2]: " option; do
case "$option" in case "$option" in
1*) 1*)
@@ -580,7 +580,7 @@ menu() {
else else
# Use a text menu if Zenity is not available # Use a text menu if Zenity is not available
clear clear
printf "\n$menu_text_terminal\n\n" printf "\n%s\n\n" "$menu_text_terminal"
PS3="Enter selection number: " PS3="Enter selection number: "
select choice in "${menu_options[@]}" select choice in "${menu_options[@]}"
@@ -725,7 +725,7 @@ getdirs() {
game_path="$wine_prefix/$default_install_path/$sc_base_dir" game_path="$wine_prefix/$default_install_path/$sc_base_dir"
else else
printf "\nUnable to detect the default game install path!\nDid you change the install location in the RSI Setup?\nDoing that is generally a bad idea but, if you are sure you want to proceed...\n\n" printf "\nUnable to detect the default game install path!\nDid you change the install location in the RSI Setup?\nDoing that is generally a bad idea but, if you are sure you want to proceed...\n\n"
printf "Enter the full path to your $sc_base_dir installation directory (case sensitive)\n" printf "Enter the full path to your %s installation directory (case sensitive)\n" "$sc_base_dir"
printf "ie. /home/USER/Games/star-citizen/drive_c/Program Files/Roberts Space Industries/StarCitizen\n" printf "ie. /home/USER/Games/star-citizen/drive_c/Program Files/Roberts Space Industries/StarCitizen\n"
while read -rp ": " game_path; do while read -rp ": " game_path; do
if [ ! -d "$game_path" ]; then if [ ! -d "$game_path" ]; then
@@ -2812,7 +2812,7 @@ Usage: lug-helper <options>
exit 0 exit 0
;; ;;
* ) * )
printf "$0: Invalid option '%s'\n" "$1" printf "%s: Invalid option '%s'\n" "$0" "$1"
exit 0 exit 0
;; ;;
esac esac