19 lines
543 B
Ruby
Raw Normal View History

2016-04-08 16:28:43 +02:00
#: * `cat` <formula>:
#: Display the source to <formula>.
module Homebrew
2016-09-26 01:44:51 +02:00
module_function
def cat
# do not "fix" this to support multiple arguments, the output would be
# unparsable, if the user wants to cat multiple formula they can call
# brew cat multiple times.
formulae = ARGV.formulae
raise FormulaUnspecifiedError if formulae.empty?
raise "`brew cat` doesn't support multiple arguments" if formulae.size > 1
cd HOMEBREW_REPOSITORY
exec "cat", formulae.first.path, *ARGV.options_only
end
end