-
Notifications
You must be signed in to change notification settings - Fork 2k
Expand file tree
/
Copy pathextractor.rs
More file actions
40 lines (32 loc) · 1023 Bytes
/
extractor.rs
File metadata and controls
40 lines (32 loc) · 1023 Bytes
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
use clap::Args;
use std::path::PathBuf;
use codeql_extractor::extractor::simple;
use codeql_extractor::trap;
#[path = "languages/swift/swift.rs"]
mod swift;
#[derive(Args)]
pub struct Options {
/// Sets a custom source archive folder
#[arg(long)]
source_archive_dir: PathBuf,
/// Sets a custom trap folder
#[arg(long)]
output_dir: PathBuf,
/// A text file containing the paths of the files to extract
#[arg(long)]
file_list: PathBuf,
}
pub fn run(options: Options) -> std::io::Result<()> {
codeql_extractor::extractor::set_tracing_level("unified");
let extractor = simple::Extractor {
prefix: "unified".to_string(),
languages: vec![
swift::language_spec(),
],
trap_dir: options.output_dir,
trap_compression: trap::Compression::from_env("CODEQL_EXTRACTOR_UNIFIED_OPTION_TRAP_COMPRESSION"),
source_archive_dir: options.source_archive_dir,
file_lists: vec![options.file_list],
};
extractor.run()
}