mirror of
https://github.com/gosticks/brew.git
synced 2026-08-13 05:00:20 +00:00
help: Let OptionParser generate help text for supported commands
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user