#![allow(clippy::cognitive_complexity)] use clap::{arg, command}; use decompress::ExtractOptsBuilder; fn main() { let matches = command!() .arg(arg!( "Archive to extract")) .arg(arg!( "Output folder")) .arg(arg!( -s --strip "Strip the first component of the archive" )) .get_matches(); let archive = matches.get_one::("archive").expect("required"); let to = matches.get_one::("out").expect("required"); let strip = usize::from(matches.get_flag("strip")); let res = decompress::decompress( archive, to, &ExtractOptsBuilder::default().strip(strip).build().unwrap(), ); println!("{res:?}"); }