diff --git a/workflow/qhtcp-workflow b/workflow/qhtcp-workflow index eea6e3ac..c9c50fd9 100755 --- a/workflow/qhtcp-workflow +++ b/workflow/qhtcp-workflow @@ -387,33 +387,51 @@ interactive_header() { echo "" echo "Available Modules:" - if [ ${#ALL_MODULES[@]} -gt 8 ]; then - # Print in two columns - for ((i=0; i<${#ALL_MODULES[@]}; i++)); do - printf "%d. %s\t" $((i+1)) "${ALL_MODULES[i]}" - if [ $((i % 2)) -eq 1 ]; then - echo - fi - done + # Determine if we need two columns + if [[ ${#ALL_MODULES[@]} -gt 8 ]]; then + # Calculate the number of elements in each column + num_columns=$(( (${#ALL_MODULES[@]} + 1) / 2 )) + + # Determine the maximum width of the first column + max_width=0 + for ((i=0; i