summaryrefslogtreecommitdiff
path: root/lib/optparse.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-12-20 07:07:19 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-12-20 07:07:19 +0000
commit07507fe37a01b461b5feb9f4c16dafe2f1276f28 (patch)
tree9aed381cd652a70ed9722ac348d31b8fa4a1e353 /lib/optparse.rb
parentd4e661b4ad7589eb0656e92bc4b702b499a65cd1 (diff)
* lib/optparse.rb (OptionParser::Completion::complete): wrong
Regexp for word boundary. pointed out by Gavin Sinclair. * lib/optparse.rb (OptionParser::make_switch): [no-] prefix was missing. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5228 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/optparse.rb')
-rw-r--r--lib/optparse.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/optparse.rb b/lib/optparse.rb
index 50da8b329d..af512e2795 100644
--- a/lib/optparse.rb
+++ b/lib/optparse.rb
@@ -80,7 +80,7 @@ Keyword completion module.
completion pattern.
=end #'#"#`#
def complete(key, pat = nil)
- pat ||= Regexp.new('\A' + Regexp.quote(key).gsub(/\w+(?=.)/, '\&\w*'),
+ pat ||= Regexp.new('\A' + Regexp.quote(key).gsub(/\w+\b/, '\&\w*'),
ignore_case?)
canon, sw, k, v, cn = nil
candidates = []
@@ -1034,7 +1034,7 @@ Default options, which never appear in option summary.
default_style = default_style.guess(arg = a)
default_pattern, conv = search(:atype, o) unless default_pattern
end
- ldesc << "--#{q}"
+ ldesc << "--[no-]#{q}"
long << (o = q.downcase)
not_pattern, not_conv = search(:atype, FalseClass) unless not_style
not_style = Switch::NoArgument