json prints without extra shit

This commit is contained in:
Alex Janka 2023-02-05 10:04:17 +11:00
parent 20986c47a4
commit 770ed39767

View file

@ -47,7 +47,7 @@ struct Args {
command: Option<Commands>,
}
#[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))