mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/optparse.rb (OptionParser::Completion#complete): default not to
ignore case on completion. [ruby-talk:84726] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4907 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
4646ba6b2a
commit
2a40bbeea0
2 changed files with 16 additions and 3 deletions
|
@ -1,4 +1,4 @@
|
||||||
Thu Nov 6 10:17:51 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Thu Nov 6 11:01:19 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* ext/stringio/stringio.c (strio_set_string, strio_reopen): check
|
* ext/stringio/stringio.c (strio_set_string, strio_reopen): check
|
||||||
tainted.
|
tainted.
|
||||||
|
@ -11,6 +11,9 @@ Thu Nov 6 10:17:51 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
* ruby.c (proc_options): reserve searched script path in the
|
* ruby.c (proc_options): reserve searched script path in the
|
||||||
source file name table. [ruby-list:38765]
|
source file name table. [ruby-list:38765]
|
||||||
|
|
||||||
|
* lib/optparse.rb (OptionParser::Completion#complete): default not to
|
||||||
|
ignore case on completion. [ruby-talk:84726]
|
||||||
|
|
||||||
Wed Nov 5 23:49:45 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
|
Wed Nov 5 23:49:45 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
|
||||||
|
|
||||||
* sample/openssl/gen_csr.rb: there (at least) is a CA which does not
|
* sample/openssl/gen_csr.rb: there (at least) is a CA which does not
|
||||||
|
|
|
@ -80,7 +80,8 @@ Keyword completion module.
|
||||||
completion pattern.
|
completion pattern.
|
||||||
=end #'#"#`#
|
=end #'#"#`#
|
||||||
def complete(key, pat = nil)
|
def complete(key, pat = nil)
|
||||||
pat ||= Regexp.new('\A' + Regexp.quote(key).gsub(/\w+(?=.)/, '\&\w*'), true)
|
pat ||= Regexp.new('\A' + Regexp.quote(key).gsub(/\w+(?=.)/, '\&\w*'),
|
||||||
|
ignore_case?)
|
||||||
canon, sw, k, v = nil
|
canon, sw, k, v = nil
|
||||||
each do |k, *v|
|
each do |k, *v|
|
||||||
(if Regexp === k
|
(if Regexp === k
|
||||||
|
@ -109,6 +110,10 @@ Keyword completion module.
|
||||||
def convert(opt = nil, val = nil, *)
|
def convert(opt = nil, val = nil, *)
|
||||||
val
|
val
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def ignore_case?
|
||||||
|
false
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
=begin private
|
=begin private
|
||||||
|
@ -122,6 +127,11 @@ Map from option/keyword string to object with completion.
|
||||||
class OptionMap < Hash
|
class OptionMap < Hash
|
||||||
include Completion
|
include Completion
|
||||||
end
|
end
|
||||||
|
class OptionCaseMap < OptionMap
|
||||||
|
def ignore_case?
|
||||||
|
true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
=begin
|
=begin
|
||||||
|
@ -383,7 +393,7 @@ summary feature.
|
||||||
def initialize
|
def initialize
|
||||||
@atype = {}
|
@atype = {}
|
||||||
@short = OptionMap.new
|
@short = OptionMap.new
|
||||||
@long = OptionMap.new
|
@long = OptionCaseMap.new
|
||||||
@list = []
|
@list = []
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue