Skip to content
Snippets Groups Projects
Commit a4ebda3f authored by Mike McQuaid's avatar Mike McQuaid
Browse files

help: support `#:` help in external commands.

parent cc59e624
No related branches found
No related tags found
No related merge requests found
......@@ -75,12 +75,9 @@ begin
end
# Usage instructions should be displayed if and only if one of:
# - a help flag is passed AND an internal command is matched
# - a help flag is passed AND a command is matched
# - a help flag is passed AND there is no command specified
# - no arguments are passed
#
# It should never affect external commands so they can handle usage
# arguments themselves.
if empty_argv || help_flag
require "cmd/help"
Homebrew.help cmd, empty_argv: empty_argv
......
......@@ -39,6 +39,8 @@ module Homebrew
if cmd
cmd = HOMEBREW_INTERNAL_COMMAND_ALIASES.fetch(cmd, cmd)
path = Commands.path(cmd)
path ||= which("brew-#{cmd}")
path ||= which("brew-#{cmd}.rb")
end
# Display command-specific (or generic) help in response to `UsageError`.
......@@ -61,7 +63,7 @@ module Homebrew
exit 0
end
# Resume execution in `brew.rb` for external/unknown commands.
# Resume execution in `brew.rb` for unknown commands.
return if path.nil?
# Display help for internal command (or generic help if undocumented).
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment