diff --git a/src/main.rs b/src/main.rs index 6381bf1..e25b4ed 100644 --- a/src/main.rs +++ b/src/main.rs @@ -47,7 +47,7 @@ struct Args { command: Option, } -#[derive(Subcommand)] +#[derive(Subcommand, PartialEq)] enum Commands { /// Get single EEPROM value Get { name: String }, @@ -87,7 +87,9 @@ fn main() { } let (_info, ram_data, eeprom_data, modbus) = if !args.fake { - println!("Connecting to device on {}", args.serial_port); + if args.command != Some(Commands::PrintJSON) { + println!("Connecting to device on {}", args.serial_port); + } let modbus = connect_modbus(&args.serial_port); let (a, b, c) = get_data(&modbus); (a, b, c, Some(modbus))