Skip to content

Fix it so that --check-app-descriptor can actually be turned off #933

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed

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

### Removed

Expand Down
16 changes: 13 additions & 3 deletions espflash/src/cli/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use std::{
path::{Path, PathBuf},
};

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

Expand Down
Loading