split hivectl main.rs into per-domain modules (#2509)
This commit is contained in:
parent
673aea4e50
commit
fc7720572b
16 changed files with 1922 additions and 1771 deletions
24
hivectl/src/approvals.rs
Normal file
24
hivectl/src/approvals.rs
Normal 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?)
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue