Skip to content

Commit 92251a9

Browse files
committed
Print additional information when invoking the save-image subcommand
1 parent ef9b8ff commit 92251a9

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

cargo-espflash/src/main.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,15 @@ fn save_image(
410410
.or(build_ctx.partition_table_path.as_deref())
411411
.map(|p| p.to_path_buf());
412412

413+
// Since we have no `Flasher` instance and as such cannot print the board
414+
// information, we will print whatever information we _do_ have.
415+
println!("Chip type: {}", args.save_image_args.chip);
416+
if let Some(format) = args.format {
417+
println!("Image format: {:?}", format);
418+
}
419+
println!("Merge: {}", args.save_image_args.merge);
420+
println!("Skip padding: {}", args.save_image_args.skip_padding);
421+
413422
save_elf_as_image(
414423
args.save_image_args.chip,
415424
&elf_data,

espflash/src/bin/espflash.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,15 @@ fn save_image(args: SaveImageArgs) -> Result<()> {
166166
.into_diagnostic()
167167
.wrap_err_with(|| format!("Failed to open image {}", args.image.display()))?;
168168

169+
// Since we have no `Flasher` instance and as such cannot print the board
170+
// information, we will print whatever information we _do_ have.
171+
println!("Chip type: {}", args.save_image_args.chip);
172+
if let Some(format) = args.format {
173+
println!("Image format: {:?}", format);
174+
}
175+
println!("Merge: {}", args.save_image_args.merge);
176+
println!("Skip padding: {}", args.save_image_args.skip_padding);
177+
169178
save_elf_as_image(
170179
args.save_image_args.chip,
171180
&elf_data,

0 commit comments

Comments
 (0)