leejarvis / slop

Simple Lightweight Option Parsing - ✨ new contributors welcome ✨

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Argument deleted when option has same-valued argument

NigoroJr opened this issue · comments

With the following snippet sample.rb,

#!/usr/bin/env ruby

require 'slop'

opts = Slop.parse do |o|
  o.integer '-t', 'Test'
end

puts opts.args

run with:

$ ./sample.rb 42 -t 42

no output is shown (when expected output is 42).

The culprit is this line.