Baptiste Fontaine fe0c57cd0f brew irb --help replaced with --examples
The --help flag is intercepted by brew.rb and prints the global usage
string. `irb` is never called when `brew irb --help` is executed.

Closes Homebrew/homebrew#35466.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2015-01-03 21:31:26 -05:00

30 lines
562 B
Ruby

require 'formula'
require 'keg'
require 'irb'
class Symbol
def f
Formulary.factory(to_s)
end
end
class String
def f
Formulary.factory(self)
end
end
module Homebrew
def irb
if ARGV.include? "--examples"
puts "'v8'.f # => instance of the v8 formula"
puts ":hub.f.installed?"
puts ":lua.f.methods - 1.methods"
puts ":mpd.f.recursive_dependencies.reject(&:installed?)"
else
ohai "Interactive Homebrew Shell"
puts "Example commands available with: brew irb --examples"
IRB.start
end
end
end