@@ -20,7 +20,7 @@ use std::{
2020    path:: { Path ,  PathBuf } , 
2121} ; 
2222
23- use  clap:: { Args ,  ValueEnum } ; 
23+ use  clap:: { ArgAction ,   Args ,  ValueEnum } ; 
2424use  clap_complete:: Shell ; 
2525use  comfy_table:: { Attribute ,  Cell ,  Color ,  Table ,  modifiers,  presets:: UTF8_FULL } ; 
2626use  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