diff options
-rw-r--r-- | lib/optparse.rb | 9 | ||||
-rw-r--r-- | test/optparse/test_optparse.rb | 22 |
2 files changed, 31 insertions, 0 deletions
@@ -1091,6 +1091,7 @@ XXX @summary_width = width @summary_indent = indent @default_argv = ARGV add_officious yield self if block_given? end @@ -1164,6 +1165,10 @@ XXX # Strings to be parsed in default. attr_accessor :default_argv # # Heading banner preceding summary. # @@ -1583,6 +1588,9 @@ XXX opt.tr!('_', '-') begin sw, = complete(:long, opt, true) rescue ParseError raise $!.set_option(arg, true) end @@ -1607,6 +1615,7 @@ XXX val = arg.delete_prefix('-') has_arg = true rescue InvalidOption # if no short options match, try completion with long # options. sw, = complete(:long, opt) @@ -75,4 +75,26 @@ class TestOptionParser < Test::Unit::TestCase assert_equal({host: "localhost", port: 8000, verbose: true}, result) assert_equal(true, @verbose) end end |