diff --git a/workflow/qhtcp-workflow b/workflow/qhtcp-workflow index 89441ffe..409fd319 100755 --- a/workflow/qhtcp-workflow +++ b/workflow/qhtcp-workflow @@ -130,7 +130,8 @@ print_help() { # @section User Input # @set PROJECTS array List of projects to work on -# @set INCLUDE_MODULES array List of modules to run +# @set MODULES array List of modules to run +# @set SUBMODULES array List of submodules and their arguments to run # @set EXCLUDE_MODULES array List of modules not to run # @set DEBUG int Turn debugging on # @set YES int Turn assume yes on @@ -152,7 +153,7 @@ parse_input() { ;; --module|-m) shift - IFS=',' read -ra INCLUDE_MODULES <<< "$1" + IFS=',' read -ra MODULES <<< "$1" ;; --submodule|-s) shift @@ -344,7 +345,7 @@ print_header() { unset response arr i fi - if [[ -z ${MODULES[*]} && -z ${INCLUDE_MODULES[*]} && -z ${EXCLUDE_MODULES[*]} ]]; then + if [[ -z ${MODULES[*]} && -z ${EXCLUDE_MODULES[*]} ]]; then echo "Enter module #'s to run (by #, comma delimited)" ((YES)) || read -r -p "Or hit Enter for default (ALL): " response if [[ -n $response ]]; then @@ -356,7 +357,7 @@ print_header() { unset response arr i fi - if [[ -z ${MODULES[*]} && -z ${INCLUDE_MODULES[*]} && -z ${EXCLUDE_MODULES[*]} && -z ${SUBMODULES[*]} ]]; then + if [[ -z ${MODULES[*]} && -z ${EXCLUDE_MODULES[*]} && -z ${SUBMODULES[*]} ]]; then while :; do echo "Enter a submodule followed by its arguments as a case delimited string in quotes" echo "Example: ${ALL_SUBMODULES[0]} \"arg1,arg2,arg3...\"" @@ -1668,20 +1669,10 @@ main() { fi done - # If we don't catch with getopt or env, run all - if [[ ${#INCLUDE_MODULES[@]} -eq 0 ]]; then - MODULES=("${ALL_MODULES[@]}") - else - MODULES=("${INCLUDE_MODULES[@]}") - fi - # Exclude modules from --exclude - arr=() - for m in "${MODULES[@]}"; do - [[ " ${EXCLUDE_MODULES[*]} " =~ [[:space:]]${m}[[:space:]] ]] || arr+=("$m") + for i in "${!MODULES[@]}"; do + [[ " ${EXCLUDE_MODULES[*]} " =~ [[:space:]]${MODULES[i]}[[:space:]] ]] && unset "MODULES[i]" done - MODULES=("${arr[@]}") - unset arr # Sanitize MODULES for i in "${!MODULES[@]}"; do