1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
pub mod rpa;
#[cfg(test)]
mod tests;
use std::path::PathBuf;
use clap::Parser;
use rpa::extract_files_from_archive_list;
pub use rpa::RenpyArchive;
pub use rpa::RpaEntry;
pub use rpa::RpaError;
use crate::rpa::DirExtractBehaviour;
const ABOUT_TEXT: &str =
"A multithreaded CLI program and library to extract files from RenPy archive files (RPAs)";
#[derive(Debug, Clone, Parser)]
#[clap(version, author, about = ABOUT_TEXT)]
pub struct Cli {
#[clap(name = "rpa_file", parse(from_os_str), required = true)]
input: Vec<PathBuf>,
#[clap(short, long, parse(from_occurrences))]
pub verbose: usize,
}
pub fn run(cli: Cli) -> Result<(), RpaError> {
let rpa_list = cli.input;
println!(
"Trying to extract all files from all archive files: {:?}",
&rpa_list
);
extract_files_from_archive_list(&rpa_list, DirExtractBehaviour::SameDir)?;
println!("Succesfully finished working on all archive files");
Ok(())
}