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]:
|
||||
#: Run Homebrew with the Ruby profiler.
|
||||
#: For example:
|
||||
# brew prof readall
|
||||
#: brew prof readall
|
||||
|
||||
module Homebrew
|
||||
module_function
|
||||
|
||||
@ -38,8 +38,13 @@ 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
|
||||
# Let OptionParser generate help text for commands which have a parser defined
|
||||
begin
|
||||
Homebrew.send("#{cmd.gsub('-','_')}_args".to_sym)
|
||||
return
|
||||
rescue NoMethodError
|
||||
nil
|
||||
end
|
||||
|
||||
# Resolve command aliases and find file containing the implementation.
|
||||
if cmd
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user