Some header work

This commit is contained in:
2024-08-01 17:22:32 -04:00
parent 5a85ffda50
commit eb26aa9624

View File

@@ -299,7 +299,7 @@ print_header() {
EOF EOF
echo "Arguments: $*" debug "Arguments: $*"
echo "" echo ""
echo "Using scans directory: $SCANS_DIR" echo "Using scans directory: $SCANS_DIR"
echo "Using output directory: $OUT_DIR" echo "Using output directory: $OUT_DIR"
@@ -334,25 +334,38 @@ print_header() {
if [[ -z ${PROJECTS[*]} ]]; then if [[ -z ${PROJECTS[*]} ]]; then
num=$((${#projects[@]})) num=$((${#projects[@]}))
echo "Enter project(s) to run (by #, comma deliminated)" echo "Enter project #'s to run (comma delimited)"
((YES)) || read -r -p "Hit enter for default ($num): " response1 ((YES)) || read -r -p "Hit enter for default ($num): " response
[[ -z $response1 ]] && response1=$num [[ -z $response ]] && response=$num
IFS=',' read -ra arr <<< "$response1" IFS=',' read -ra arr <<< "$response"
for i in "${arr[@]}"; do for i in "${arr[@]}"; do
PROJECTS+=("${projects[$((i-1))]}") PROJECTS+=("${projects[$((i-1))]}")
done done
unset response arr i
fi fi
if [[ -z ${MODULES[*]} ]]; then if [[ -z ${MODULES[*]} ]]; then
echo "Enter module(s) to run (by #, comma deliminated)" echo "Enter module #'s to run (by #, comma delimited)"
read -r -p "Hit enter for default (ALL): " response1 ((YES)) || read -r -p "Hit enter for default (ALL): " response
IFS=',' read -ra MODULES <<< "$response1" if [[ -n $response ]]; then
IFS=',' read -ra arr <<< "$response"
for i in "${arr[@]}"; do
MODULES+=("${ALL_MODULES[$((i-1))]}")
done
fi
unset response arr i
fi fi
if [[ -z ${SUBMODULES[*]} ]]; then if [[ -z ${SUBMODULES[*]} ]]; then
echo "Enter submodule(s) to run (by #, comma deliminated):" echo "Enter submodule #'s to run (by #, comma delimited):"
read -r -p "Hit enter for default (ALL): " response2 read -r -p "Hit enter for default (ALL): " response
IFS=',' read -ra SUBMODULES <<< "$response2" if [[ -n $response ]]; then
IFS=',' read -ra arr <<< "$response"
for i in "${arr[@]}"; do
SUBMODULES+=("${ALL_SUBMODULES[$((i-1))]}")
done
fi
unset response arr i
fi fi
# cat <<-EOF # cat <<-EOF