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
|
# - a help flag is passed AND there is no command specified
|
||||||
# - no arguments are passed
|
# - no arguments are passed
|
||||||
# - 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" && !internal_dev_cmd
|
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
|
||||||
# `Homebrew.help` never returns, except for external/unknown commands.
|
# `Homebrew.help` never returns, except for external/unknown commands.
|
||||||
|
@ -38,6 +38,9 @@ module Homebrew
|
|||||||
module_function
|
module_function
|
||||||
|
|
||||||
def help(cmd = nil, flags = {})
|
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.
|
# Resolve command aliases and find file containing the implementation.
|
||||||
if cmd
|
if cmd
|
||||||
cmd = HOMEBREW_INTERNAL_COMMAND_ALIASES.fetch(cmd, cmd)
|
cmd = HOMEBREW_INTERNAL_COMMAND_ALIASES.fetch(cmd, cmd)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user