diff --git a/Library/Homebrew/cask/lib/hbc/cli/internal_stanza.rb b/Library/Homebrew/cask/lib/hbc/cli/internal_stanza.rb index c046197989..1b15d9386b 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