#!/usr/bin/env bash
# commands/group/rm-peers.sh

function cmd::group::rm_peers::on_load() {
  flag::define --name  value "Group name" required label:name
  flag::define --force bool  "Skip confirmation"
}

function cmd::group::rm_peers::run() {
  flag::parse "$@" || return 1
  local name; name=$(flag::value --name)
  local force=false; flag::bool --force && force=true
  [[ -z "$name" ]] && log::error "Missing required flag: --name" && return 1
  group::require_exists "$name" || return 1
  cmd::group::_rm_peers_impl "$name" "$force"
}
