Move --help handling of dev commands to help.rb
This commit is contained in:
parent
acd9a335a5
commit
df101dde84
@ -73,7 +73,7 @@ begin
|
||||
# - a help flag is passed AND there is no command specified
|
||||
# - no arguments are passed
|
||||
# - if cmd is Cask, let Cask handle the help command instead
|
||||
if (empty_argv || help_flag) && cmd != "cask" && !internal_dev_cmd
|
||||
if (empty_argv || help_flag) && cmd != "cask"
|
||||
require "help"
|
||||
Homebrew::Help.help cmd, empty_argv: empty_argv
|
||||
# `Homebrew.help` never returns, except for external/unknown commands.
|
||||
|
@ -38,6 +38,9 @@ module Homebrew
|
||||
module_function
|
||||
|
||||
def help(cmd = nil, flags = {})
|
||||
# Let OptionParser generate help text for developer commands
|
||||
return if require? HOMEBREW_LIBRARY_PATH/"dev-cmd"/cmd
|
||||
|
||||
# Resolve command aliases and find file containing the implementation.
|
||||
if cmd
|
||||
cmd = HOMEBREW_INTERNAL_COMMAND_ALIASES.fetch(cmd, cmd)
|
||||
|
Loading…
x
Reference in New Issue
Block a user