Skip to content

Commit e2f64de

Browse files
authored
Merge pull request github#12774 from hmac/merge-extractor-binaries
2 parents f1246af + 8ffb81f commit e2f64de

File tree

8 files changed

+588
-127
lines changed

8 files changed

+588
-127
lines changed

ql/Cargo.lock

Lines changed: 275 additions & 43 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ql/extractor/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ tree-sitter-ql-dbscheme = { git = "https://github.com/erik-krogh/tree-sitter-ql-
1313
tree-sitter-ql-yaml = {git = "https://github.com/erik-krogh/tree-sitter-ql.git", rev = "cf704bf3671e1ae148e173464fb65a4d2bbf5f99"}
1414
tree-sitter-blame = {path = "../buramu/tree-sitter-blame"}
1515
tree-sitter-json = {git = "https://github.com/tausbn/tree-sitter-json.git", rev = "745663ee997f1576fe1e7187e6347e0db36ec7a9"}
16-
clap = "2.33"
16+
clap = "4.2"
1717
tracing = "0.1"
1818
tracing-subscriber = { version = "0.3.16", features = ["env-filter"] }
1919
rayon = "1.7.0"

ql/extractor/src/bin/extractor.rs

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -58,27 +58,29 @@ fn main() -> std::io::Result<()> {
5858
.build_global()
5959
.unwrap();
6060

61-
let matches = clap::App::new("QL extractor")
61+
let matches = clap::Command::new("QL extractor")
6262
.version("1.0")
6363
.author("GitHub")
6464
.about("CodeQL QL extractor")
65-
.args_from_usage(
66-
"--source-archive-dir=<DIR> 'Sets a custom source archive folder'
67-
--output-dir=<DIR> 'Sets a custom trap folder'
68-
--file-list=<FILE_LIST> 'A text files containing the paths of the files to extract'",
69-
)
65+
.args(&[
66+
clap::arg!(--"source-archive-dir" <DIR> "Sets a custom source archive folder"),
67+
clap::arg!(--"output-dir" <DIR> "Sets a custom trap folder"),
68+
clap::arg!(--"file-list" <FILE_LIST> "A text file containing the paths of the files to extract"),
69+
])
7070
.get_matches();
7171
let src_archive_dir = matches
72-
.value_of("source-archive-dir")
72+
.get_one::<String>("source-archive-dir")
7373
.expect("missing --source-archive-dir");
7474
let src_archive_dir = PathBuf::from(src_archive_dir);
7575

7676
let trap_dir = matches
77-
.value_of("output-dir")
77+
.get_one::<String>("output-dir")
7878
.expect("missing --output-dir");
7979
let trap_dir = PathBuf::from(trap_dir);
8080

81-
let file_list = matches.value_of("file-list").expect("missing --file-list");
81+
let file_list = matches
82+
.get_one::<String>("file-list")
83+
.expect("missing --file-list");
8284
let file_list = fs::File::open(file_list)?;
8385

8486
let language = tree_sitter_ql::language();

ql/extractor/src/bin/generator.rs

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,23 @@ fn main() -> std::io::Result<()> {
1010
.with_env_filter(tracing_subscriber::EnvFilter::from_default_env())
1111
.init();
1212

13-
let matches = clap::App::new("QL dbscheme generator")
13+
let matches = clap::Command::new("QL dbscheme generator")
1414
.version("1.0")
1515
.author("GitHub")
1616
.about("CodeQL QL dbscheme generator")
17-
.args_from_usage(
18-
"--dbscheme=<FILE> 'Path of the generated dbscheme file'
19-
--library=<FILE> 'Path of the generated QLL file'",
20-
)
17+
.args(&[
18+
clap::arg!(--dbscheme <FILE> "Path of the generated dbscheme file"),
19+
clap::arg!(--library <FILE> "Path of the generated QLL file"),
20+
])
2121
.get_matches();
22-
let dbscheme_path = matches.value_of("dbscheme").expect("missing --dbscheme");
22+
let dbscheme_path = matches
23+
.get_one::<String>("dbscheme")
24+
.expect("missing --dbscheme");
2325
let dbscheme_path = PathBuf::from(dbscheme_path);
2426

25-
let ql_library_path = matches.value_of("library").expect("missing --library");
27+
let ql_library_path = matches
28+
.get_one::<String>("library")
29+
.expect("missing --library");
2630
let ql_library_path = PathBuf::from(ql_library_path);
2731

2832
let languages = vec![

0 commit comments

Comments
 (0)