return option value for short option also

This commit is contained in:
josh committed 2013-01-22 14:03:27 -05:00
1 parent cf049aed2f
commit 90d2a938d5
2 files changed
+18 -3

No files matched your search

+10
View File
@@ -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