From ad45cbde5db96ee77482e940ccd5b0d56943116f Mon Sep 17 00:00:00 2001 From: Bryan Roessler Date: Sun, 4 Aug 2024 00:44:43 -0400 Subject: [PATCH] Try printing modules in two columns --- workflow/qhtcp-workflow | 56 ++++++++++++++++++++++++++++++++--------- 1 file changed, 44 insertions(+), 12 deletions(-) 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