Conversation
There was a problem hiding this comment.
Pull request overview
Adds plugin-aware help handling so plugin commands can receive a --help request instead of Bundler/Thor crashing when -h/--help is used with a plugin command.
Changes:
- Delegate
bundle <plugin_cmd> -h/--helphandling to the plugin by interceptingBundler::CLI#help. - Add an RSpec covering help-flag behavior for plugin commands.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
bundler/lib/bundler/cli.rb |
Routes help requests for plugin commands to Bundler::Plugin.exec_command(..., ["--help"]). |
bundler/spec/plugins/command_spec.rb |
Adds a spec ensuring plugin commands can handle -h/--help without crashing. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| bundle "greet --help" | ||
| expect(out).to eq("Usage: bundle greet [NAME]") | ||
|
|
||
| bundle "greet -h" | ||
| expect(out).to eq("Usage: bundle greet [NAME]") | ||
| end |
There was a problem hiding this comment.
This spec covers bundle greet --help and bundle greet -h, but the change in Bundler::CLI#help also affects bundle help greet (which is another common way to request help and previously triggered the crash path). Adding an assertion for bundle "help greet" would better lock in the intended behavior and prevent regressions specific to the help subcommand.
There was a problem hiding this comment.
@copilot open a new pull request to apply changes based on this feedback
Co-authored-by: hsbt <12301+hsbt@users.noreply.github.com>
What was the end-user or developer problem that led to this PR?
Fixes #8437
What is your fix for the problem, implemented in this PR?
Pass
--helpflag to plugin when using plugin cli.Make sure the following tasks are checked