Skip to content
Snippets Groups Projects
Commit 8ae55ae8 authored by Samuel Tardieu's avatar Samuel Tardieu
Browse files

Add firmware-updater status --short

parent 78eb4372
No related branches found
No related tags found
1 merge request!52Various changes
......@@ -55,4 +55,7 @@ pub struct StatusArgs {
/// I²C bus to use
#[clap(short, long, default_value = "8")]
pub i2c_bus: u8,
/// Print only the running program, version, and extra arguments, separated by spaces
#[clap(short, long)]
pub short: bool,
}
......@@ -252,6 +252,10 @@ fn cmd_flash(args: &FlashArgs) -> Result<()> {
fn cmd_status(args: &StatusArgs) -> Result<()> {
let mut i2c = I2c::with_bus(args.i2c_bus)?;
let active_program = bootloader::active_program(&mut i2c)?;
if args.short {
println!("{active_program}");
return Ok(());
}
println!("Running program: {active_program}");
if matches!(active_program, ActiveProgram::Bootloader { .. }) {
if i2c.get_programming_status()?.application_present() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment