Skip to content
Merged
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: 13 additions & 2 deletions pldm-fw-cli/src/bin/pldm-fw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,10 @@ struct ExtractCommand {
/// components to extract (by index)
#[argh(positional)]
components: Vec<usize>,

/// extract all components
#[argh(switch)]
all: bool,
}

#[derive(FromArgs, Debug)]
Expand Down Expand Up @@ -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:?}");
Expand Down