mirror of
https://github.com/xavo95/repak.git
synced 2025-01-18 19:04:07 +00:00
20 lines
685 B
Rust
20 lines
685 B
Rust
fn main() -> Result<(), un_pak::Error> {
|
|
// drag onto or open any pak with the example
|
|
let path = std::env::args().nth(1).unwrap_or_default();
|
|
for ver in un_pak::Version::iter() {
|
|
match un_pak::Pak::new(
|
|
std::io::BufReader::new(std::fs::OpenOptions::new().read(true).open(&path)?),
|
|
ver,
|
|
None,
|
|
) {
|
|
Ok(un_pak::Pak { version, .. }) | Err(un_pak::Error::Version { version, .. }) => {
|
|
println!("{}", version);
|
|
break;
|
|
}
|
|
_ => continue,
|
|
}
|
|
}
|
|
// so you can read the results
|
|
std::thread::sleep(std::time::Duration::from_secs(10));
|
|
Ok(())
|
|
}
|