From c01a5ee85e2d6a7128cccafb143bfa694284ca87 Mon Sep 17 00:00:00 2001 From: kazu Date: Tue, 4 Dec 2018 08:22:10 +0000 Subject: Use delete_prefix instead of `sub(/\Afixed-pattern/, '')` git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66189 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/optparse.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/optparse.rb') diff --git a/lib/optparse.rb b/lib/optparse.rb index c6e652971e..5cdcabf4a7 100644 --- a/lib/optparse.rb +++ b/lib/optparse.rb @@ -1595,7 +1595,7 @@ XXX begin sw, = complete(:short, opt) # short option matched. - val = arg.sub(/\A-/, '') + val = arg.delete_prefix('-') has_arg = true rescue InvalidOption # if no short options match, try completion with long -- cgit v1.2.3