help: print cli/parser help message if used
This commit is contained in:
parent
d014d5a982
commit
e9274b3827
@ -94,7 +94,7 @@ begin
|
|||||||
# - if cmd is Cask, let Cask handle the help command instead
|
# - if cmd is Cask, let Cask handle the help command instead
|
||||||
if (empty_argv || help_flag) && cmd != "cask"
|
if (empty_argv || help_flag) && cmd != "cask"
|
||||||
require "help"
|
require "help"
|
||||||
Homebrew::Help.help cmd, empty_argv: empty_argv
|
Homebrew::Help.help cmd, empty_argv: empty_argv, internal_cmd: internal_cmd
|
||||||
# `Homebrew.help` never returns, except for external/unknown commands.
|
# `Homebrew.help` never returns, except for external/unknown commands.
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -72,6 +72,9 @@ module Homebrew
|
|||||||
# Resume execution in `brew.rb` for unknown commands.
|
# Resume execution in `brew.rb` for unknown commands.
|
||||||
return if path.nil?
|
return if path.nil?
|
||||||
|
|
||||||
|
# Resume execution in `brew.rb` for external commands using "cli/parser".
|
||||||
|
return if !flags[:internal_cmd] && path.read.match?("require .cli/parser.")
|
||||||
|
|
||||||
# Display help for internal command (or generic help if undocumented).
|
# Display help for internal command (or generic help if undocumented).
|
||||||
puts command_help(path)
|
puts command_help(path)
|
||||||
exit 0
|
exit 0
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user