Browse Source

Fixed --start vs. --start-rule inconsistency between help and actual option processing code.

redux
David Majda 12 years ago
parent
commit
d3104742d9
  1. 2
      Rakefile
  2. 4
      bin/pegjs-main.js

2
Rakefile

@ -22,7 +22,7 @@ file "lib/pegjs-runtime-#{version}.min.js" => "lib/runtime.js" do |t|
end
file "lib/metagrammar.js" => "lib/metagrammar.pegjs" do |t|
system "bin/pegjs --start grammar PEG.grammarParser lib/metagrammar.pegjs"
system "bin/pegjs --start-rule grammar PEG.grammarParser lib/metagrammar.pegjs"
end
desc "Build the minified parser runtime"

4
bin/pegjs-main.js

@ -95,10 +95,10 @@ var args = Array.prototype.slice.call(arguments, 1);
while (args.length > 0 && isOption(args[0])) {
switch (args[0]) {
case "-s":
case "--start":
case "--start-rule":
nextArg();
if (args.length === 0) {
abort("Missing parameter of the -s/--start option.");
abort("Missing parameter of the -s/--start-rule option.");
}
startRule = args[0];
break;

Loading…
Cancel
Save