mqrs/src/main.rs
finga 1100ba1b13 Support timeout and deadline parameters for send
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.
2021-06-20 16:49:40 +02:00

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(())
}