diff --git a/workflow/qhtcp-workflow b/workflow/qhtcp-workflow index 99a29118..d3b19dca 100755 --- a/workflow/qhtcp-workflow +++ b/workflow/qhtcp-workflow @@ -411,21 +411,53 @@ interactive_header() { # echo "" echo "Available Submodules:" - if [ ${#ALL_SUBMODULES[@]} -gt 8 ]; then - # Print in two columns - for ((i=0; i<${#ALL_SUBMODULES[@]}; i++)); do - printf "%d. %s\t" $((i+1)) "${ALL_SUBMODULES[i]}" - if [ $((i % 2)) -eq 1 ]; then - echo - fi - done + if [ ${#ALL_SUBMODULES[@]} -gt 8 ]; then + # Calculate the number of elements in each column + num_columns=$(( (${#ALL_SUBMODULES[@]} + 1) / 2 )) + # Print in two columns + for ((i=0; i