feat: allow setting the output directory for generated source files

This commit is contained in:
JCWasmx86 2023-09-09 19:25:14 +02:00 committed by Amaan Qureshi
parent 5e8401fb1d
commit 099fd4efb7
2 changed files with 12 additions and 1 deletions

View file

@ -101,6 +101,13 @@ struct Generate {
help = "The path to the directory containing the parser library"
)]
pub libdir: Option<String>,
#[arg(
long,
short,
value_name = "DIRECTORY",
help = "The path to output the generated source files"
)]
pub output: Option<String>,
#[arg(
long,
help = "Produce a report of the states for the given rule, use `-` to report every rule"
@ -693,6 +700,7 @@ impl Generate {
});
tree_sitter_generate::generate_parser_in_directory(
current_dir,
self.output.as_deref(),
self.grammar_path.as_deref(),
abi_version,
self.report_states_for_rule.as_deref(),