mqrs/src/unlink.rs

23 lines
425 B
Rust
Raw Normal View History

2021-06-14 03:27:24 +02:00
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(())
}
}