finga
12b117db7e
To supporte more than a single log level `log` and `env_logger` crates are used. For the application to support the different type of argument, the verbose argument definition was adapted.
22 lines
387 B
Rust
22 lines
387 B
Rust
use anyhow::Result;
|
|
use clap::Clap;
|
|
use log::info;
|
|
|
|
/// Delete a message queue
|
|
#[derive(Clap, Debug)]
|
|
pub struct Unlink {
|
|
/// Name of the queue
|
|
#[clap(value_name = "QUEUE")]
|
|
pub queue: String,
|
|
}
|
|
|
|
impl Unlink {
|
|
pub fn run(&self) -> Result<()> {
|
|
posixmq::remove_queue(&self.queue)?;
|
|
|
|
info!("Removed message queue: {}", &self.queue);
|
|
|
|
Ok(())
|
|
}
|
|
}
|