wgctl/commands/group/group.sh
Nuno Duque Nunes ce437968b4 feat: group migration complete
- commands/group/: 17 files, all subcommands migrated
- helpers.sh: real implementations, no invented functions
- set_main: uses peers::set_main_group
- rename: json::set + mv
- peer add/remove: group::add_peer, group::remove_peer
- block/unblock: block::add_group, block::remove_group
- purge-stale: inline stale detection via group::peers
- audit: no invented helper functions
- logs: command::load_subcmd logs show for direct function access
- logs/helpers.sh: extracted shared functions (follow, show_fw, show_wg, show_merged)
- group rule unassign: stub (not yet implemented)
- notes: group watch pending, monitor module refactor pending
2026-05-31 02:44:19 +00:00

24 lines
1.1 KiB
Bash

#!/usr/bin/env bash
# commands/group/group.sh — router only
function cmd::group::on_load() {
command::helpers "helpers.sh"
command::define list "List all groups" [*, ls]
command::define show "Show group details" [info]
command::define add "Create a new group" [new, create]
command::define remove "Remove a group" [rm, del, delete]
command::define rename "Rename a group"
command::define peer "Manage group peers"
command::define rm-peers "Remove all peers from a group" [rm-peers]
command::define set-main "Set main group for a peer" [set-main]
command::define block "Block all peers in a group"
command::define unblock "Unblock all peers in a group"
command::define rule "Manage group rules"
command::define purge-stale "Remove stale peers from groups" [purge]
command::define audit "Audit group membership"
command::define logs "Show logs for group peers"
command::define watch "Watch logs for group peers"
}
hook::on "command:help:group" command::help::auto