help: Let OptionParser generate help text for supported commands
This commit is contained in:
parent
f60582ca48
commit
604dfb4ae6
@ -1,7 +1,7 @@
|
|||||||
#: * `prof` [ruby options]:
|
#: * `prof` [ruby options]:
|
||||||
#: Run Homebrew with the Ruby profiler.
|
#: Run Homebrew with the Ruby profiler.
|
||||||
#: For example:
|
#: For example:
|
||||||
# brew prof readall
|
#: brew prof readall
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew
|
||||||
module_function
|
module_function
|
||||||
|
|||||||
@ -38,8 +38,13 @@ module Homebrew
|
|||||||
module_function
|
module_function
|
||||||
|
|
||||||
def help(cmd = nil, flags = {})
|
def help(cmd = nil, flags = {})
|
||||||
# Let OptionParser generate help text for developer commands
|
# Let OptionParser generate help text for commands which have a parser defined
|
||||||
return if require? HOMEBREW_LIBRARY_PATH/"dev-cmd"/cmd
|
begin
|
||||||
|
Homebrew.send("#{cmd.gsub('-','_')}_args".to_sym)
|
||||||
|
return
|
||||||
|
rescue NoMethodError
|
||||||
|
nil
|
||||||
|
end
|
||||||
|
|
||||||
# Resolve command aliases and find file containing the implementation.
|
# Resolve command aliases and find file containing the implementation.
|
||||||
if cmd
|
if cmd
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user