finga
1100ba1b13
Add support for timeout and deadline parameters when messages are sent to a message queue. To keep code duplication small, the `utils.rs` file contains a helper function to parse the `Duration` from the `String` received from the timeout parameter. Add conflict rules for the timeout and deadline parameters.
27 lines
489 B
Rust
27 lines
489 B
Rust
use anyhow::Result;
|
|
use clap::Clap;
|
|
|
|
mod cli;
|
|
mod create;
|
|
mod info;
|
|
mod recv;
|
|
mod send;
|
|
mod unlink;
|
|
mod utils;
|
|
|
|
use cli::{Command, Opts};
|
|
|
|
fn main() -> Result<()> {
|
|
let opts: Opts = Opts::parse();
|
|
|
|
match opts.command {
|
|
Command::Create(c) => c.run(opts.verbose)?,
|
|
Command::Info(i) => i.run()?,
|
|
Command::Unlink(u) => u.run(opts.verbose)?,
|
|
Command::Send(s) => s.run(opts.verbose)?,
|
|
Command::Recv(r) => r.run(opts.verbose)?,
|
|
}
|
|
|
|
Ok(())
|
|
}
|