aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDominyk Tiller2015-10-25 01:13:16 +0100
committerDominyk Tiller2015-10-26 14:06:51 +0000
commit82f5660752849771ad2164545ee33c8a78c2a339 (patch)
tree06e0eeb7c14e29b127c7814cd786b87b406f3ec8
parentdb66177d6c4a7a65adf44ea9de07bd7a5873c76c (diff)
downloadbrew-82f5660752849771ad2164545ee33c8a78c2a339.tar.bz2
cat: raise unless object is formulae
Until a point in time when the Cask/Homebrew codebases are harmonised a little more it probably makes sense to refuse to `cat` Casks. Right now the Homebrew codebase is only minimally aware of what a Cask is. Fixes Homebrew/homebrew#45300. Fixes Homebrew/homebrew#44630. Closes Homebrew/homebrew#45302. Signed-off-by: Dominyk Tiller <dominyktiller@gmail.com>
-rw-r--r--Library/Homebrew/cmd/cat.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/Library/Homebrew/cmd/cat.rb b/Library/Homebrew/cmd/cat.rb
index f42fbc037..b42e54a57 100644
--- a/Library/Homebrew/cmd/cat.rb
+++ b/Library/Homebrew/cmd/cat.rb
@@ -3,9 +3,11 @@ module Homebrew
# 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
- raise FormulaUnspecifiedError if ARGV.named.empty?
cd HOMEBREW_REPOSITORY
- exec "cat", ARGV.formulae.first.path, *ARGV.options_only
+ exec "cat", formulae.first.path, *ARGV.options_only
end
end