1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* lib/optparse.rb (OptionParser::Completion#candidate),

(OptionParser::Switch#compsys): remove unused variables.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30120 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2010-12-07 13:29:49 +00:00
parent 4ec63ef245
commit ff1fb42734
2 changed files with 6 additions and 2 deletions

View file

@ -1,3 +1,8 @@
Tue Dec 7 22:29:45 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/optparse.rb (OptionParser::Completion#candidate),
(OptionParser::Switch#compsys): remove unused variables.
Tue Dec 7 22:05:25 2010 Nobuyoshi Nakada <nobu@ruby-lang.org> Tue Dec 7 22:05:25 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
* transcode.c (transcode_loop): call default handler of the given * transcode.c (transcode_loop): call default handler of the given

View file

@ -229,7 +229,6 @@ class OptionParser
def self.candidate(key, icase = false, pat = nil, &block) def self.candidate(key, icase = false, pat = nil, &block)
pat ||= Completion.regexp(key, icase) pat ||= Completion.regexp(key, icase)
canon, sw, cn = nil
candidates = [] candidates = []
block.call do |k, *v| block.call do |k, *v|
(if Regexp === k (if Regexp === k
@ -442,7 +441,7 @@ class OptionParser
end end
def compsys(sdone, ldone) # :nodoc: def compsys(sdone, ldone) # :nodoc:
sopts, lopts, s = [], [], nil sopts, lopts = [], []
@short.each {|s| sdone.fetch(s) {sopts << s}; sdone[s] = true} if @short @short.each {|s| sdone.fetch(s) {sopts << s}; sdone[s] = true} if @short
@long.each {|s| ldone.fetch(s) {lopts << s}; ldone[s] = true} if @long @long.each {|s| ldone.fetch(s) {lopts << s}; ldone[s] = true} if @long
return if sopts.empty? and lopts.empty? # completely hidden return if sopts.empty? and lopts.empty? # completely hidden