split hivectl main.rs into per-domain modules (#2509)

This commit is contained in:
damocles 2026-07-16 11:17:50 +02:00
commit fc7720572b
16 changed files with 1922 additions and 1771 deletions

24
hivectl/src/approvals.rs Normal file
View file

@ -0,0 +1,24 @@
//! `hivectl approvals` — the operator approval queue (pending/approve/deny).
use std::path::Path;
use anyhow::Result;
use hive_host_sock::HostRequest;
use crate::cli::ApprovalsCmd;
use crate::util::render;
/// Dispatch `hivectl approvals <verb>` — the operator approval queue.
pub(crate) async fn run_approvals(socket: &Path, cmd: ApprovalsCmd) -> Result<()> {
match cmd {
ApprovalsCmd::Pending => {
render(crate::client::request(socket, HostRequest::Pending).await?)
}
ApprovalsCmd::Approve { id } => {
render(crate::client::request(socket, HostRequest::Approve { id }).await?)
}
ApprovalsCmd::Deny { id } => {
render(crate::client::request(socket, HostRequest::Deny { id }).await?)
}
}
}