aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew
diff options
context:
space:
mode:
Diffstat (limited to 'Library/Homebrew')
-rw-r--r--Library/Homebrew/cmd/help.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/Library/Homebrew/cmd/help.rb b/Library/Homebrew/cmd/help.rb
index c8fc33430..b8dcad3d5 100644
--- a/Library/Homebrew/cmd/help.rb
+++ b/Library/Homebrew/cmd/help.rb
@@ -40,6 +40,14 @@ module Homebrew
path = command_path(cmd)
end
+ # Display command-specific (or generic) help in response to `UsageError`.
+ if (error_message = flags[:usage_error])
+ $stderr.puts path ? command_help(path) : HOMEBREW_HELP
+ $stderr.puts
+ onoe error_message
+ exit 1
+ end
+
# Handle `brew` (no arguments).
if flags[:empty_argv]
$stderr.puts HOMEBREW_HELP