mqrs/src/unlink.rs
2021-06-14 23:01:24 +02:00

22 lines
425 B
Rust

use anyhow::Result;
use clap::Clap;
/// Delete a message queue
#[derive(Clap, Debug)]
pub struct Unlink {
/// Name of the queue
#[clap(value_name = "QNAME")]
pub queue: String,
}
impl Unlink {
pub fn run(&self, verbose: bool) -> Result<()> {
posixmq::remove_queue(&self.queue)?;
if verbose {
println!("Removed message queue: {}", &self.queue);
}
Ok(())
}
}