diff options
| author | L. E. Segovia | 2017-10-12 00:11:11 -0300 |
|---|---|---|
| committer | L. E. Segovia | 2017-10-12 00:11:11 -0300 |
| commit | d1262868a9073304a244cdf7f582ffd27514c47c (patch) | |
| tree | ba9e55383a0b77986dfa1a81e0bfcf1b81c8ac3c /Library/Homebrew | |
| parent | 91ab116ace7f4f97d3440190463c93be9ec6d675 (diff) | |
| download | brew-d1262868a9073304a244cdf7f582ffd27514c47c.tar.bz2 | |
Fixes help querying
- If a non-existent command with a flag is queried to Cask, the latter
is printed instead of the command
- If the help from a not-yet-tapped cask's command is queried, it
prints brew tap's help infinitely
Fixes caskroom/homebrew-cask#28977
Diffstat (limited to 'Library/Homebrew')
| -rw-r--r-- | Library/Homebrew/brew.rb | 5 | ||||
| -rw-r--r-- | Library/Homebrew/cask/lib/hbc/cli.rb | 2 |
2 files changed, 5 insertions, 2 deletions
diff --git a/Library/Homebrew/brew.rb b/Library/Homebrew/brew.rb index 41955e60e..3c561e857 100644 --- a/Library/Homebrew/brew.rb +++ b/Library/Homebrew/brew.rb @@ -32,7 +32,7 @@ begin empty_argv = ARGV.empty? help_flag_list = %w[-h --help --usage -?] - help_flag = !ENV["HOMEBREW_HELP"].nil? + help_flag = false internal_cmd = true cmd = nil @@ -44,6 +44,9 @@ begin help_flag = true elsif !cmd && !help_flag_list.include?(arg) cmd = ARGV.delete_at(i) + elsif help_flag_list.include?(arg) & cmd + # cmd determined, and it needs help + help_flag = true end end diff --git a/Library/Homebrew/cask/lib/hbc/cli.rb b/Library/Homebrew/cask/lib/hbc/cli.rb index d260be4e3..bd50e41a6 100644 --- a/Library/Homebrew/cask/lib/hbc/cli.rb +++ b/Library/Homebrew/cask/lib/hbc/cli.rb @@ -231,7 +231,7 @@ module Hbc return if @command == "help" && @args.empty? unknown_command = @args.empty? ? @command : @args.first - raise ArgumentError, "Unknown command: #{unknown_command}" + raise ArgumentError, "Unknown command: #{@command} #{@args.join(" ")}" end def purpose |
