Actions
Bug #14162
closedInvoking binding.irb destructively shifts ARGV
Description
$ ruby -v
ruby 2.5.0dev (2017-12-05 trunk 61034) [x86_64-linux]
$ cat script.rb
binding.irb
binding.irb
$ ruby script.rb a b c
From: script.rb @ line 1 :
=> 1: binding.irb
2: binding.irb
irb(main):001:0> p ARGV
["b", "c"]
=> ["b", "c"]
irb(main):002:0>
From: script.rb @ line 2 :
1: binding.irb
=> 2: binding.irb
irb(main):001:0> p ARGV
["c"]
=> ["c"]
Is this intentional? This is reproductive on both Ruby 2.4 and 2.5.
Actions
Like0
Like0Like0Like0