gistfile1.txt
· 637 B · Text
Raw
# Group summary
local group_summary=""
if $has_groups; then
declare -A group_counts
for peer in "${!peer_group_map[@]}"; do
local g="${peer_group_map[$peer]}"
group_counts["$g"]=$(( ${group_counts["$g"]:-0} + 1 )) || true
done
for g in "${!group_counts[@]}"; do
group_summary+="${group_counts[$g]} in ${g}, "
done
group_summary="${group_summary%, }"
fi
declare -A rule_counts
for name in "${!p_rules[@]}"; do
local r="${p_rules[$name]}"
rule_counts["$r"]=$(( ${rule_counts["$r"]:-0} + 1 )) || true
done
cmd::list::_render_summary "$group_summary" rule_counts
| 1 | # Group summary |
| 2 | local group_summary="" |
| 3 | if $has_groups; then |
| 4 | declare -A group_counts |
| 5 | for peer in "${!peer_group_map[@]}"; do |
| 6 | local g="${peer_group_map[$peer]}" |
| 7 | group_counts["$g"]=$(( ${group_counts["$g"]:-0} + 1 )) || true |
| 8 | done |
| 9 | for g in "${!group_counts[@]}"; do |
| 10 | group_summary+="${group_counts[$g]} in ${g}, " |
| 11 | done |
| 12 | group_summary="${group_summary%, }" |
| 13 | fi |
| 14 | |
| 15 | declare -A rule_counts |
| 16 | for name in "${!p_rules[@]}"; do |
| 17 | local r="${p_rules[$name]}" |
| 18 | rule_counts["$r"]=$(( ${rule_counts["$r"]:-0} + 1 )) || true |
| 19 | done |
| 20 | cmd::list::_render_summary "$group_summary" rule_counts |