зеркало из https://github.com/github/ruby.git
[rubygems/rubygems] Properly resolve aliases when `bundle help` is run
https://github.com/rubygems/rubygems/commit/5d9bf03c59
This commit is contained in:
Родитель
64bd8e41df
Коммит
5577f138b4
|
@ -114,6 +114,8 @@ module Bundler
|
|||
class_option "verbose", type: :boolean, desc: "Enable verbose output mode", aliases: "-V"
|
||||
|
||||
def help(cli = nil)
|
||||
cli = self.class.all_aliases[cli] if self.class.all_aliases[cli]
|
||||
|
||||
case cli
|
||||
when "gemfile" then command = "gemfile"
|
||||
when nil then command = "bundle"
|
||||
|
@ -683,7 +685,6 @@ module Bundler
|
|||
exec_used = args.index {|a| exec_commands.include? a }
|
||||
|
||||
command = args.find {|a| bundler_commands.include? a }
|
||||
command = all_aliases[command] if all_aliases[command]
|
||||
|
||||
if exec_used && help_used
|
||||
if exec_used + help_used == 1
|
||||
|
|
|
@ -15,6 +15,13 @@ RSpec.describe "bundle help" do
|
|||
expect(out).to eq(%(["#{man_dir}/bundle-install.1"]))
|
||||
end
|
||||
|
||||
it "prexifes bundle commands with bundle- and resolves aliases when finding the man files" do
|
||||
with_fake_man do
|
||||
bundle "help package"
|
||||
end
|
||||
expect(out).to eq(%(["#{man_dir}/bundle-cache.1"]))
|
||||
end
|
||||
|
||||
it "simply outputs the human readable file when there is no man on the path" do
|
||||
with_path_as("") do
|
||||
bundle "help install"
|
||||
|
|
Загрузка…
Ссылка в новой задаче