diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/jcode.rb | 2 | ||||
-rw-r--r-- | lib/optparse.rb | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/lib/jcode.rb b/lib/jcode.rb index df2cd61b3f..1e8fd64518 100644 --- a/lib/jcode.rb +++ b/lib/jcode.rb @@ -9,7 +9,7 @@ class String printf STDERR, "feel free for some warnings:\n" if $VERBOSE def _regex_quote(str) - str.gsub(/(\\[\]\[\-\\])|\\(.)|([\]\[\\])/) do + str.gsub(/(\\[\[\]\-\\])|\\(.)|([\[\]\\])/) do $1 || $2 || '\\' + $3 end end diff --git a/lib/optparse.rb b/lib/optparse.rb index 1da5ef2cc0..ea1ba61356 100644 --- a/lib/optparse.rb +++ b/lib/optparse.rb @@ -965,7 +965,7 @@ Default options, which never appear in option summary. raise ArgumentError, "unsupported argument type: #{o}" when *ArgumentStyle.keys style = notwice(ArgumentStyle[o], style, 'style') - when /^--no-([^\]\[=\s]*)(.+)?/ + when /^--no-([^\[\]=\s]*)(.+)?/ q, a = $1, $2 o = notwice(a ? Object : TrueClass, klass, 'type') not_pattern, not_conv = search(:atype, o) unless not_style @@ -975,7 +975,7 @@ Default options, which never appear in option summary. ldesc << "--no-#{q}" long << 'no-' + (q = q.downcase) nolong << q - when /^--\[no-\]([^\]\[=\s]*)(.+)?/ + when /^--\[no-\]([^\[\]=\s]*)(.+)?/ q, a = $1, $2 o = notwice(a ? Object : TrueClass, klass, 'type') if a @@ -987,7 +987,7 @@ Default options, which never appear in option summary. not_pattern, not_conv = search(:atype, FalseClass) unless not_style not_style = Switch::NoArgument nolong << 'no-' + o - when /^--([^\]\[=\s]*)(.+)?/ + when /^--([^\[\]=\s]*)(.+)?/ q, a = $1, $2 if a o = notwice(NilClass, klass, 'type') |