diff --git a/workflow/qhtcp-workflow b/workflow/qhtcp-workflow index 7f191d09..224919d3 100755 --- a/workflow/qhtcp-workflow +++ b/workflow/qhtcp-workflow @@ -299,7 +299,7 @@ print_header() { EOF - echo "Arguments: $*" + debug "Arguments: $*" echo "" echo "Using scans directory: $SCANS_DIR" echo "Using output directory: $OUT_DIR" @@ -334,25 +334,38 @@ print_header() { if [[ -z ${PROJECTS[*]} ]]; then num=$((${#projects[@]})) - echo "Enter project(s) to run (by #, comma deliminated)" - ((YES)) || read -r -p "Hit enter for default ($num): " response1 - [[ -z $response1 ]] && response1=$num - IFS=',' read -ra arr <<< "$response1" + echo "Enter project #'s to run (comma delimited)" + ((YES)) || read -r -p "Hit enter for default ($num): " response + [[ -z $response ]] && response=$num + IFS=',' read -ra arr <<< "$response" for i in "${arr[@]}"; do PROJECTS+=("${projects[$((i-1))]}") done + unset response arr i fi if [[ -z ${MODULES[*]} ]]; then - echo "Enter module(s) to run (by #, comma deliminated)" - read -r -p "Hit enter for default (ALL): " response1 - IFS=',' read -ra MODULES <<< "$response1" + echo "Enter module #'s to run (by #, comma delimited)" + ((YES)) || read -r -p "Hit enter for default (ALL): " response + 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 if [[ -z ${SUBMODULES[*]} ]]; then - echo "Enter submodule(s) to run (by #, comma deliminated):" - read -r -p "Hit enter for default (ALL): " response2 - IFS=',' read -ra SUBMODULES <<< "$response2" + echo "Enter submodule #'s to run (by #, comma delimited):" + read -r -p "Hit enter for default (ALL): " response + 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 # cat <<-EOF