Ultima attività 1 month ago

nuno ha revisionato questo gist 1 month ago. Vai alla revisione

1 file changed, 24 insertions

gistfile1.txt(file creato)

@@ -0,0 +1,24 @@
1 + function cmd::inspect::_group_info() {
2 + local name="$1"
3 +
4 + local groups=()
5 + mapfile -t groups < <(json::peer_groups "$(ctx::groups)" "$name")
6 +
7 + ui::empty "${groups[*]}" && return 0
8 + ui::section "Groups"
9 + printf "\n"
10 +
11 + if [[ ${#groups[@]} -eq 0 ]] || [[ -z "${groups[0]:-}" ]]; then
12 + printf " —\n"
13 + return 0
14 + fi
15 +
16 + for g in "${groups[@]}"; do
17 + [[ -z "$g" ]] && continue
18 + local count
19 + count=$(json::count "$(group::path "$g")" "peers")
20 + printf " %-20s %s peers\n" "$g" "$count"
21 + done
22 +
23 + return 0
24 + }
Più nuovi Più vecchi