use mqi::{connect_options::{ClientDefinition, Credentials, MqServerSyntaxError}, types::{ObjectName, QueueManagerName}}; #[derive(clap::Parser, Debug)] pub struct ConnectionArgs { #[arg(long)] pub mqserver: Option, #[arg(long)] pub queue_manager: Option, #[arg(short, long)] pub username: Option, #[arg(short, long)] pub password: Option, } impl ConnectionArgs { pub fn client_definition(&self) -> Result, MqServerSyntaxError> { self .mqserver .as_deref() .map(ClientDefinition::from_mqserver) .transpose() // Option -> Result