1
0
Fork 0

Add name, about, version to CLI output

refactor
Bo Jeanes 2022-09-04 16:56:18 +10:00
parent 8a1f340e01
commit 2afad811df
1 changed files with 8 additions and 3 deletions

View File

@ -8,8 +8,6 @@ use tracing::{debug, error, info};
use thiserror::Error; use thiserror::Error;
use clap::Parser;
mod modbus; mod modbus;
#[derive(Error, Debug)] #[derive(Error, Debug)]
@ -24,7 +22,13 @@ pub enum Error {
type Result<T> = std::result::Result<T, Error>; type Result<T> = std::result::Result<T, Error>;
#[derive(Parser)] #[derive(clap::Parser)]
#[clap(
name = "modbus-mqtt",
version,
author,
about = "A bridge between Modbus and MQTT"
)]
struct Cli { struct Cli {
mqtt_host: String, mqtt_host: String,
@ -56,6 +60,7 @@ enum MainStatus {
async fn main() -> Result<()> { async fn main() -> Result<()> {
tracing_subscriber::fmt::init(); tracing_subscriber::fmt::init();
use clap::Parser;
let args = Cli::parse(); let args = Cli::parse();
let (registry_tx, registry_rx) = mpsc::channel::<RegistryCommand>(32); let (registry_tx, registry_rx) = mpsc::channel::<RegistryCommand>(32);