Skip to content

Commit b611374

Browse files
committed
Fix it so that --check-app-descriptor can actually be turned off
1 parent b993a42 commit b611374

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1212
### Changed
1313

1414
### Fixed
15+
- Make it possible to actually turn off the `--check-app-descriptor` flag
1516

1617
### Removed
1718

espflash/src/cli/mod.rs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use std::{
2020
path::{Path, PathBuf},
2121
};
2222

23-
use clap::{Args, ValueEnum};
23+
use clap::{ArgAction, Args, ValueEnum};
2424
use clap_complete::Shell;
2525
use comfy_table::{Attribute, Cell, Color, Table, modifiers, presets::UTF8_FULL};
2626
use config::PortConfig;
@@ -257,8 +257,17 @@ pub struct ImageArgs {
257257
/// MMU page size.
258258
#[arg(long, value_name = "MMU_PAGE_SIZE", value_parser = parse_u32)]
259259
pub mmu_page_size: Option<u32>,
260-
/// Flag to check the app descriptor in bootloader
261-
#[arg(long, default_value = "true", value_parser = clap::value_parser!(bool))]
260+
/// Check the image for the presence of the app descriptor struct that newer ESP-IDF bootloaders (V5.4+) require
261+
// See https://github.com/clap-rs/clap/issues/1649#issuecomment-2144879038
262+
#[arg(
263+
long,
264+
action = ArgAction::Set,
265+
default_value_t = true,
266+
// somehow clap has this option not properly supported in derive, so it needs to be a string
267+
default_missing_value = "true",
268+
num_args = 0..=1,
269+
require_equals = false,
270+
)]
262271
pub check_app_descriptor: bool,
263272
}
264273

0 commit comments

Comments
 (0)