|
|
@ -31,8 +31,8 @@ function printHelp() {
|
|
|
|
console.log(" to peg.generate");
|
|
|
|
console.log(" to peg.generate");
|
|
|
|
console.log(" --extra-options-file <file> file with additional options (in JSON");
|
|
|
|
console.log(" --extra-options-file <file> file with additional options (in JSON");
|
|
|
|
console.log(" format) to pass to peg.generate");
|
|
|
|
console.log(" format) to pass to peg.generate");
|
|
|
|
console.log(" --format <format> format of the generated parser: amd, global,");
|
|
|
|
console.log(" --format <format> format of the generated parser: amd,");
|
|
|
|
console.log(" node, umd (default: node)");
|
|
|
|
console.log(" globals, node, umd (default: node)");
|
|
|
|
console.log(" -h, --help print help and exit");
|
|
|
|
console.log(" -h, --help print help and exit");
|
|
|
|
console.log(" -O, --optimize <goal> select optimization for speed or size");
|
|
|
|
console.log(" -O, --optimize <goal> select optimization for speed or size");
|
|
|
|
console.log(" (default: speed)");
|
|
|
|
console.log(" (default: speed)");
|
|
|
@ -186,8 +186,8 @@ while (args.length > 0 && isOption(args[0])) {
|
|
|
|
if (args.length === 0) {
|
|
|
|
if (args.length === 0) {
|
|
|
|
abort("Missing parameter of the --format option.");
|
|
|
|
abort("Missing parameter of the --format option.");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (args[0] !== "amd" && args[0] !== "global" && args[0] !== "node" && args[0] !== "umd") {
|
|
|
|
if (args[0] !== "amd" && args[0] !== "globals" && args[0] !== "node" && args[0] !== "umd") {
|
|
|
|
abort("Module format must be one of \"amd\", \"global\", \"node\", and \"umd\".");
|
|
|
|
abort("Module format must be one of \"amd\", \"globals\", \"node\", and \"umd\".");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
options.format = args[0];
|
|
|
|
options.format = args[0];
|
|
|
|
break;
|
|
|
|
break;
|
|
|
@ -263,7 +263,7 @@ if (objects.keys(options.dependencies).length > 0) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (options.exportVar !== null) {
|
|
|
|
if (options.exportVar !== null) {
|
|
|
|
if (options.format !== "global" && options.format !== "umd") {
|
|
|
|
if (options.format !== "globals" && options.format !== "umd") {
|
|
|
|
abort("Can't use the -e/--export-var option with the \"" + options.format + "\" module format.");
|
|
|
|
abort("Can't use the -e/--export-var option with the \"" + options.format + "\" module format.");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|