aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMartin Schimandl2017-10-03 19:35:43 +0200
committerMartin Schimandl2017-11-10 20:16:38 +0100
commitb7a51eab6be0d62674231699d513db310df608b8 (patch)
tree3e704e0804039c74d10de52ea5eac043d309eaee /Library
parent441c212f2dd70f053ee21eac8398c5fe5dfd0551 (diff)
downloadbrew-b7a51eab6be0d62674231699d513db310df608b8.tar.bz2
improve 'brew cask _stanza' by checking for known stanzas
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/cask/lib/hbc/cli/internal_stanza.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/Library/Homebrew/cask/lib/hbc/cli/internal_stanza.rb b/Library/Homebrew/cask/lib/hbc/cli/internal_stanza.rb
index c04619798..1b15d9386 100644
--- a/Library/Homebrew/cask/lib/hbc/cli/internal_stanza.rb
+++ b/Library/Homebrew/cask/lib/hbc/cli/internal_stanza.rb
@@ -43,6 +43,10 @@ module Hbc
@stanza = args.shift.to_sym
@format = :to_yaml if yaml?
+
+ unless DSL::DSL_METHODS.include?(stanza)
+ raise ArgumentError, "Illegal stanza: '#{stanza}'"
+ end
end
def run