Remove obsolete -V short flag from --visibility option#1703
Open
st0012 wants to merge 2 commits intoruby:masterfrom
Open
Remove obsolete -V short flag from --visibility option#1703st0012 wants to merge 2 commits intoruby:masterfrom
st0012 wants to merge 2 commits intoruby:masterfrom
Conversation
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.
There was a problem hiding this comment.
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
-Vfrom--visibility=VISIBILITYoption registration so--visibilityis long-form only. - Add a test asserting both
--verboseand-Vset 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
--visibilityoption declared-Vas a short flag, but--verbosedeclares the same-Vlater in the option parser. OptionParser silently lets the later registration win, so-Vhas actually been an alias for--verboserather than--visibility— making the visibility short flag obsolete and misleading anyone who reads the source expecting it to work.This drops
-Vfrom the--visibility=VISIBILITYdefinition inlib/rdoc/options.rb.--verbose -Vcontinues to work exactly as before;--visibilityretains its long form. There is no behavior change for users who were relying on whatever-Vactually did at runtime.Adds
test_parse_verbosetotest/rdoc/rdoc_options_test.rbso the-V→--verbosewiring is locked in and a future re-introduction of the duplicate short flag would be caught by the test suite.