Add optional destination dir for OSB file extraction

This commit is contained in:
2023-11-02 20:56:46 +01:00
parent f851e9c424
commit 1f5ec80cc6
3 changed files with 18 additions and 7 deletions

View File

@@ -259,11 +259,19 @@ fn main() -> Result<(), Box<dyn Error>> {
};
}
#[cfg(feature = "unzip-osb")]
SubCommand::UnzipOsb { file, password } => {
SubCommand::UnzipOsb {
file,
password,
dir,
} => {
use crate::unzip_osb::unzip_osb;
match password {
Some(password) => unzip_osb_using_password(file.as_str(), password.as_str()),
None => unzip_osb(file.as_str()),
Some(password) => unzip_osb_using_password(
file.as_str(),
dir.unwrap_or_default().as_str(),
password.as_str(),
),
None => unzip_osb(file.as_str(), dir.unwrap_or_default().as_str()),
}
}
};