stevedlawrence commented on code in PR #1262:
URL: https://github.com/apache/daffodil/pull/1262#discussion_r1642651401
##########
containers/release-candidate/src/daffodil-release-candidate:
##########
@@ -46,6 +46,25 @@ Options:
USAGE
}
+# Function to get a non-empty string as input
+get_non_empty_input() {
+ local prompt="$1" # prompt the user with this string
+ local input
+
+ while true; do
+ # Prompt the user for input
+ read -p "$prompt" input
+
+ # Check if the input is non-empty
+ if [[ -n $input ]]; then
+ echo "$input"
+ return 0
+ else
+ echo "Empty input. Please try again."
Review Comment:
Does the "empty input" message need to go to stderr? Otherwise I think it
will become part of resulting variable.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]