Skip to content

Commit c31e909

Browse files
committed
Fix OptionParser ARGV processing
1 parent 85c4d6b commit c31e909

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

ext/generate_constants.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class ConstantParser
1212
def self.run(argv)
1313
s = self.new
1414
options = Struct.new(:verbose, :const, :files).new
15-
OptionParser.new(argv) do |opts|
15+
OptionParser.new do |opts|
1616
opts.banner = "Usage: #{$0} [options] <header-file.h>*"
1717

1818
opts.on("-v", "--[no-]verbose", "Run verbosely", &options.method(:verbose=))
@@ -21,7 +21,7 @@ def self.run(argv)
2121
puts opts
2222
exit
2323
end
24-
end.parse!
24+
end.parse!(argv)
2525
options.files = argv
2626
s.options = options
2727
s.start!

ext/generate_structs.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class StructParser
1515
def self.run(argv)
1616
s = self.new
1717
options = Struct.new(:verbose, :def, :impl, :doc, :files).new
18-
OptionParser.new(argv) do |opts|
18+
OptionParser.new do |opts|
1919
opts.banner = "Usage: #{$0} [options] <header-file.h>*"
2020

2121
opts.on("-v", "--[no-]verbose", "Run verbosely", &options.method(:verbose=))
@@ -26,7 +26,7 @@ def self.run(argv)
2626
puts opts
2727
exit
2828
end
29-
end.parse!
29+
end.parse!(argv)
3030
options.files = argv
3131
s.options = options
3232
s.start!

0 commit comments

Comments
 (0)