File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed
Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -240,6 +240,10 @@ struct ExtractCommand {
240240 /// components to extract (by index)
241241 #[ argh( positional) ]
242242 components : Vec < usize > ,
243+
244+ /// extract all components
245+ #[ argh( switch) ]
246+ all : bool ,
243247}
244248
245249#[ derive( FromArgs , Debug ) ]
@@ -364,10 +368,18 @@ fn main() -> anyhow::Result<()> {
364368 }
365369 Command :: Extract ( e) => {
366370 let pkg = open_package ( e. file ) ?;
367- if e. components . is_empty ( ) {
371+
372+ let comps = if e. all {
373+ ( 0 ..pkg. components . len ( ) ) . collect ( )
374+ } else {
375+ e. components
376+ } ;
377+
378+ if comps. is_empty ( ) {
368379 println ! ( "No components specified to extract" ) ;
369380 }
370- for idx in e. components {
381+ for idx in comps {
382+ println ! ( "idx {idx}" ) ;
371383 let res = extract_component ( & pkg, idx) ;
372384 if let Err ( e) = res {
373385 println ! ( "Error extracting: {e:?}" ) ;
You can’t perform that action at this time.
0 commit comments