Skip to content
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

Do not require the --partition-table argument when erasing partitions #413

Merged
merged 1 commit into from
May 30, 2023
Merged
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
15 changes: 2 additions & 13 deletions espflash/src/cli/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,21 +89,10 @@ pub struct FlashArgs {
#[arg(long, value_name = "FILE")]
pub bootloader: Option<PathBuf>,
/// Erase partitions by label
#[arg(
long,
requires = "partition_table",
value_name = "LABELS",
value_delimiter = ','
)]
#[arg(long, value_name = "LABELS", value_delimiter = ',')]
pub erase_parts: Option<Vec<String>>,
/// Erase specified data partitions
#[arg(
long,
requires = "partition_table",
value_name = "PARTS",
value_enum,
value_delimiter = ','
)]
#[arg(long, value_name = "PARTS", value_enum, value_delimiter = ',')]
pub erase_data_parts: Option<Vec<DataType>>,
/// Image format to flash
#[arg(long, value_enum)]
Expand Down
7 changes: 5 additions & 2 deletions espflash/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -387,8 +387,11 @@ impl From<String> for MissingPartition {
}

#[derive(Debug, Error, Diagnostic)]
#[error("No partition table could be found at the specified path")]
#[diagnostic(code(espflash::partition_table::missing_partition_table))]
#[error("No partition table could be found")]
#[diagnostic(
code(espflash::partition_table::missing_partition_table),
help("Try providing a CSV or binary paritition table with the `--partition-table` argument.")
)]
pub struct MissingPartitionTable;

#[derive(Debug, Error)]
Expand Down