return option value for short option also
This commit is contained in:
1 parent
cf049aed2f
commit
90d2a938d5
2 files changed
+18
-3
No files matched your search
@@ -107,5 +107,15 @@ describe Yawpa do
|
||||
opts[:option].should be_true
|
||||
args.should eq(['qqq'])
|
||||
end
|
||||
|
||||
it "returns option argument at next position for a short option" do
|
||||
options = {
|
||||
option: {nargs: 1, short: 'o'},
|
||||
}
|
||||
params = ['-o', 'val', 'rrr']
|
||||
opts, args = Yawpa.parse(params, options)
|
||||
opts[:option].should eq('val')
|
||||
args.should eq(['rrr'])
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in new issue
Block a user