@@ -20,7 +20,7 @@ use std::{
20
20
path:: { Path , PathBuf } ,
21
21
} ;
22
22
23
- use clap:: { Args , ValueEnum } ;
23
+ use clap:: { ArgAction , Args , ValueEnum } ;
24
24
use clap_complete:: Shell ;
25
25
use comfy_table:: { Attribute , Cell , Color , Table , modifiers, presets:: UTF8_FULL } ;
26
26
use config:: PortConfig ;
@@ -257,8 +257,17 @@ pub struct ImageArgs {
257
257
/// MMU page size.
258
258
#[ arg( long, value_name = "MMU_PAGE_SIZE" , value_parser = parse_u32) ]
259
259
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
+ ) ]
262
271
pub check_app_descriptor : bool ,
263
272
}
264
273
0 commit comments