Skip to content

Remove obsolete -V short flag from --visibility option#1703

Open
st0012 wants to merge 2 commits intoruby:masterfrom
st0012:claude/remove-obsolete-v-flag-IK6yd
Open

Remove obsolete -V short flag from --visibility option#1703
st0012 wants to merge 2 commits intoruby:masterfrom
st0012:claude/remove-obsolete-v-flag-IK6yd

Conversation

@st0012
Copy link
Copy Markdown
Member

@st0012 st0012 commented May 9, 2026

The --visibility option declared -V as a short flag, but --verbose declares the same -V later in the option parser. OptionParser silently lets the later registration win, so -V has actually been an alias for --verbose rather than --visibility — making the visibility short flag obsolete and misleading anyone who reads the source expecting it to work.

This drops -V from the --visibility=VISIBILITY definition in lib/rdoc/options.rb. --verbose -V continues to work exactly as before; --visibility retains its long form. There is no behavior change for users who were relying on whatever -V actually did at runtime.

Adds test_parse_verbose to test/rdoc/rdoc_options_test.rb so the -V--verbose wiring is locked in and a future re-introduction of the duplicate short flag would be caught by the test suite.

claude added 2 commits May 9, 2026 06:26
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.
Locks in that -V is the short flag for --verbose so the prior
duplication with --visibility cannot silently regress.
Copilot AI review requested due to automatic review settings May 9, 2026 07:41
@st0012 st0012 added the bug label May 9, 2026
@st0012 st0012 requested a deployment to fork-preview-protection May 9, 2026 07:41 — with GitHub Actions Waiting
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR removes the obsolete -V short flag from the --visibility option in RDoc::Options, eliminating a misleading duplicate short flag that was already effectively claimed by --verbose. It also adds a regression test to ensure -V continues to map to --verbose.

Changes:

  • Remove -V from --visibility=VISIBILITY option registration so --visibility is long-form only.
  • Add a test asserting both --verbose and -V set verbosity to the verbose level.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
lib/rdoc/options.rb Drops -V from --visibility to avoid a duplicate short flag and align runtime behavior with the source.
test/rdoc/rdoc_options_test.rb Adds coverage ensuring -V remains an alias for --verbose by asserting verbosity behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
Member

@kou kou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants