From 0a48396ffd83c6860fa71e8ce306a0ed18923e2b Mon Sep 17 00:00:00 2001 From: the-sane <3657071+the-sane@users.noreply.github.com> Date: Mon, 22 Jan 2024 11:41:57 -0500 Subject: [PATCH] Text menus: Don't pause when invoked via command line arguments --- lug-helper.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lug-helper.sh b/lug-helper.sh index 03ecea7..5bf6445 100755 --- a/lug-helper.sh +++ b/lug-helper.sh @@ -368,7 +368,10 @@ message() { # info message # call format: message info "text to display" printf "\n$2\n\n" - read -n 1 -s -p "Press any key..." + 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..." + fi ;; "warning") # warning message @@ -2565,6 +2568,7 @@ Usage: lug-helper # Call the requested functions and exit if [ "${#cargs[@]}" -gt 0 ]; then + cmd_line="true" for (( x=0; x<"${#cargs[@]}"; x++ )); do ${cargs[x]} done