From c60db09987f61f00e203083b395a236a8e2a3c83 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 9 May 2026 06:26:51 +0000 Subject: [PATCH 1/2] Remove obsolete -V short flag from --visibility option The -V flag was registered on both --visibility and --verbose. Since OptionParser resolves short-flag conflicts in favor of the later declaration, --verbose owned -V in practice, leaving the visibility short flag dead. Drop it to clear the duplicate registration. --- lib/rdoc/options.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rdoc/options.rb b/lib/rdoc/options.rb index 5bc23f832e..141c9fdb04 100644 --- a/lib/rdoc/options.rb +++ b/lib/rdoc/options.rb @@ -895,7 +895,7 @@ def parse(argv) opt.separator nil - opt.on("--visibility=VISIBILITY", "-V", RDoc::VISIBILITIES + [:nodoc], + opt.on("--visibility=VISIBILITY", RDoc::VISIBILITIES + [:nodoc], "Minimum visibility to document a method.", "One of 'public', 'protected' (the default),", "'private' or 'nodoc' (show everything)") do |value| From 133bbe377b25890d9f5cf9ab0b4803a820fb8faf Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 9 May 2026 06:30:24 +0000 Subject: [PATCH 2/2] Add test for --verbose / -V option parsing Locks in that -V is the short flag for --verbose so the prior duplication with --visibility cannot silently regress. --- test/rdoc/rdoc_options_test.rb | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/rdoc/rdoc_options_test.rb b/test/rdoc/rdoc_options_test.rb index c884eb451e..d39ce81974 100644 --- a/test/rdoc/rdoc_options_test.rb +++ b/test/rdoc/rdoc_options_test.rb @@ -697,6 +697,15 @@ def test_parse_visibility assert_equal :nodoc, @options.visibility end + def test_parse_verbose + @options.parse %w[--verbose] + assert_equal 2, @options.verbosity + + @options = RDoc::Options.new + @options.parse %w[-V] + assert_equal 2, @options.verbosity + end + def test_parse_write_options tmpdir = File.join Dir.tmpdir, "test_rdoc_options_#{$$}" FileUtils.mkdir_p tmpdir