-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Expand file tree
/
Copy pathgenerator.rs
More file actions
45 lines (39 loc) · 1.13 KB
/
generator.rs
File metadata and controls
45 lines (39 loc) · 1.13 KB
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
use clap::Args;
use std::path::PathBuf;
use codeql_extractor::generator::{generate, language::Language};
#[derive(Args)]
pub struct Options {
/// Path of the generated dbscheme file
#[arg(long)]
dbscheme: PathBuf,
/// Path of the generated QLL file
#[arg(long)]
library: PathBuf,
}
pub fn run(options: Options) -> std::io::Result<()> {
tracing_subscriber::fmt()
.with_target(false)
.without_time()
.with_level(true)
.with_env_filter(tracing_subscriber::EnvFilter::from_default_env())
.init();
let languages = vec![
Language {
name: "QL".to_owned(),
node_types: tree_sitter_ql::NODE_TYPES,
},
Language {
name: "Dbscheme".to_owned(),
node_types: tree_sitter_ql_dbscheme::NODE_TYPES,
},
Language {
name: "Blame".to_owned(),
node_types: tree_sitter_blame::NODE_TYPES,
},
Language {
name: "JSON".to_owned(),
node_types: tree_sitter_json::NODE_TYPES,
},
];
generate(languages, options.dbscheme, options.library)
}