From 114dee1a7cfbae601ce11901b20516ebe217a4b2 Mon Sep 17 00:00:00 2001 From: Matt Johnston Date: Wed, 18 Feb 2026 18:46:29 +0800 Subject: [PATCH] pldm-fw-cli: Add extract --all Signed-off-by: Matt Johnston --- pldm-fw-cli/src/bin/pldm-fw.rs | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/pldm-fw-cli/src/bin/pldm-fw.rs b/pldm-fw-cli/src/bin/pldm-fw.rs index 636ebda..bdb55dc 100644 --- a/pldm-fw-cli/src/bin/pldm-fw.rs +++ b/pldm-fw-cli/src/bin/pldm-fw.rs @@ -240,6 +240,10 @@ struct ExtractCommand { /// components to extract (by index) #[argh(positional)] components: Vec, + + /// extract all components + #[argh(switch)] + all: bool, } #[derive(FromArgs, Debug)] @@ -364,10 +368,17 @@ fn main() -> anyhow::Result<()> { } Command::Extract(e) => { let pkg = open_package(e.file)?; - if e.components.is_empty() { + + let comps = if e.all { + (0..pkg.components.len()).collect() + } else { + e.components + }; + + if comps.is_empty() { println!("No components specified to extract"); } - for idx in e.components { + for idx in comps { let res = extract_component(&pkg, idx); if let Err(e) = res { println!("Error extracting: {e:?}");