#!/usr/bin/env bash
# commands/group/set-main.sh

function cmd::group::set_main::on_load() {
  flag::define --name value "Group name" required label:name
  flag::define --peer value "Peer name"  required label:peer
}

function cmd::group::set_main::run() {
  flag::parse "$@" || return 1
  local name; name=$(flag::value --name)
  local peer; peer=$(flag::value --peer)
  [[ -z "$name" || -z "$peer" ]] && \
    log::error "Missing required flags: --name and --peer" && return 1
  cmd::group::_set_main_impl "$name" "$peer"
}
