Try printing modules in two columns

This commit is contained in:
2024-08-04 00:37:31 -04:00
parent 26a4f3a800
commit be4dd81fe5

View File

@@ -387,11 +387,31 @@ interactive_header() {
echo ""
echo "Available Modules:"
# Print the array with item numbers in two columns
if [ ${#ALL_MODULES[@]} -gt 8 ]; then
# Print in two columns
for ((i=0; i<${#ALL_MODULES[@]}; i++)); do
printf "%d\t%s\n" $((i+1)) "${ALL_MODULES[i]}"
done | column -t -s $'\t'
echo ""
printf "%d. %s\t" $((i+1)) "${ALL_MODULES[i]}"
if [ $((i % 2)) -eq 1 ]; then
echo
fi
done
else
# Print in a single column
for ((i=0; i<${#ALL_MODULES[@]}; i++)); do
printf "%d. %s\n" $((i+1)) "${ALL_MODULES[i]}"
done
fi
# # Print the array with item numbers in two columns
# for ((i=0; i<${#ALL_MODULES[@]}; i++)); do
# printf "%d\t%s\n" $((i+1)) "${ALL_MODULES[i]}"
# done | column -t -s $'\t'
# echo ""
echo "Available Submodules:"
for i in "${!ALL_SUBMODULES[@]}"; do