Try printing modules in two columns

This commit is contained in:
2024-08-04 00:39:02 -04:00
parent be4dd81fe5
commit 34553f48a3

View File

@@ -401,10 +401,7 @@ interactive_header() {
printf "%d. %s\n" $((i+1)) "${ALL_MODULES[i]}" printf "%d. %s\n" $((i+1)) "${ALL_MODULES[i]}"
done done
fi fi
echo ""
# # Print the array with item numbers in two columns # # Print the array with item numbers in two columns
@@ -414,10 +411,25 @@ interactive_header() {
# echo "" # echo ""
echo "Available Submodules:" echo "Available Submodules:"
for i in "${!ALL_SUBMODULES[@]}"; do if [ ${#ALL_SUBMODULES[@]} -gt 8 ]; then
printf "%d. %s\n" "$((i+1))" "${ALL_SUBMODULES[i]}" # 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 done
else
# Print in a single column
for ((i=0; i<${#ALL_SUBMODULES[@]}; i++)); do
printf "%d. %s\n" $((i+1)) "${ALL_SUBMODULES[i]}"
done
fi
echo "" echo ""
# for i in "${!ALL_SUBMODULES[@]}"; do
# printf "%d. %s\n" "$((i+1))" "${ALL_SUBMODULES[i]}"
# done
# echo ""
# Gather and list projects from SCANS_DIR # Gather and list projects from SCANS_DIR
shopt -s nullglob shopt -s nullglob