Cleanup prompts
This commit is contained in:
@@ -535,7 +535,7 @@ interactive_header() {
|
||||
Enter project number(s) to analyze:
|
||||
* A comma-separated list of project numbers (ex. 2,5,12)
|
||||
* 0 to add a new project
|
||||
* Enter to accept the default (newest) project ($num)
|
||||
* <Enter> for the latest project ($num)
|
||||
EOF
|
||||
((YES)) || read -r -p "($num): " response
|
||||
if [[ $response == 0 ]]; then
|
||||
@@ -566,8 +566,14 @@ interactive_header() {
|
||||
done
|
||||
|
||||
if [[ ${#MODULES[@]} -eq 0 && ${#EXCLUDE_MODULES[@]} -eq 0 ]]; then
|
||||
echo "Enter a comma-separated list of modules to run"
|
||||
((YES)) || read -r -p "Hit Enter for all (default) or '0' for none: " response
|
||||
cat <<-EOF
|
||||
Enter modules(s) to run:
|
||||
* A comma-separated list of module numbers
|
||||
* Example: 2,5,12
|
||||
* 0 for none
|
||||
* <Enter> for all modules (default)
|
||||
EOF
|
||||
((YES)) || read -r -p "(all): " response
|
||||
if [[ -z $response ]]; then
|
||||
MODULES=("${ALL_MODULES[@]}")
|
||||
elif [[ $response -eq 0 ]]; then
|
||||
@@ -583,16 +589,21 @@ interactive_header() {
|
||||
|
||||
if [[ ${#MODULES[@]} -eq 0 && ${#EXCLUDE_MODULES[@]} -eq 0 && ${#SUBMODULES[@]} -eq 0 ]]; then
|
||||
while :; do
|
||||
echo "Enter a submodule followed by its arguments as a comma-separated string"
|
||||
echo "Quote your string if there are any whitespaces"
|
||||
echo "Example: ${ALL_SUBMODULES[0]} \"arg1,arg2,arg3...\""
|
||||
((YES)) || read -r -p "Or hit Enter to continue: " response
|
||||
cat <<-EOF
|
||||
Enter submodules(s) to run followed by its arguments in a comma-separated string
|
||||
* Quote your string if there are any whitespaces
|
||||
* A comma-separated list of submodules and their arguments
|
||||
* Both arguments are required
|
||||
* Example: ${ALL_SUBMODULES[0]},\"arg1,arg2,arg3...\",${ALL_SUBMODULES[1]},\"arg1,arg2,arg3...\"
|
||||
* <Enter> for none (default)
|
||||
EOF
|
||||
((YES)) || read -r -p "(none): " response
|
||||
[[ -z $response ]] && break
|
||||
IFS=' ' read -ra arr <<< "$response"
|
||||
if [[ ! ${#arr[@]} -eq 2 ]]; then
|
||||
err "The second argument is required and may be an empty string, \"\""
|
||||
else
|
||||
IFS=',' read -ra arr <<< "$response"
|
||||
if [[ $((${#arr[@]} % 2)) -eq 0 ]]; then # check if array is even
|
||||
SUBMODULES+=("${arr[@]}")
|
||||
else
|
||||
err "The second argument is required (may be an empty string, \"\")"
|
||||
fi
|
||||
unset response arr i
|
||||
done
|
||||
|
||||
Reference in New Issue
Block a user