Allow passing grammar JS or JSON path to generate command
This commit is contained in:
parent
8f48240bf1
commit
def5884b59
3 changed files with 26 additions and 11 deletions
|
|
@ -43,6 +43,7 @@ fn run() -> error::Result<()> {
|
|||
.subcommand(
|
||||
SubCommand::with_name("generate")
|
||||
.about("Generate a parser")
|
||||
.arg(Arg::with_name("grammar-path").index(1))
|
||||
.arg(Arg::with_name("log").long("log"))
|
||||
.arg(Arg::with_name("properties-only").long("properties"))
|
||||
.arg(
|
||||
|
|
@ -84,6 +85,7 @@ fn run() -> error::Result<()> {
|
|||
logger::init();
|
||||
}
|
||||
|
||||
let grammar_path = matches.value_of("grammar-path");
|
||||
let minimize = !matches.is_present("no-minimize");
|
||||
let properties_only = matches.is_present("properties-only");
|
||||
let state_ids_to_log = matches
|
||||
|
|
@ -94,6 +96,7 @@ fn run() -> error::Result<()> {
|
|||
});
|
||||
generate::generate_parser_in_directory(
|
||||
¤t_dir,
|
||||
grammar_path,
|
||||
minimize,
|
||||
state_ids_to_log,
|
||||
properties_only,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue