23 lines
425 B
Rust
23 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(())
|
||
|
}
|
||
|
}
|