aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMarkus Reiter2017-02-10 09:06:12 +0100
committerGitHub2017-02-10 09:06:12 +0100
commitb6265276c8fd28ef08e7bff2468ab5a30c48feb6 (patch)
tree93dcaa7c93acbaca431dd1fb73a8c63fb057e47b /Library
parentc528f0d4cb75c035fae0de46bcc35be68cee664d (diff)
parent455369b10c270bc6e11a1a007d109da3027e4205 (diff)
downloadbrew-b6265276c8fd28ef08e7bff2468ab5a30c48feb6.tar.bz2
Merge pull request #1755 from reitermarkus/brew-cask-_stanza
Display message when running `brew cask _stanza` without arguments.
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/cask/lib/hbc/cli.rb2
-rw-r--r--Library/Homebrew/cask/lib/hbc/cli/internal_stanza.rb6
2 files changed, 5 insertions, 3 deletions
diff --git a/Library/Homebrew/cask/lib/hbc/cli.rb b/Library/Homebrew/cask/lib/hbc/cli.rb
index 2b2211877..73ab121d2 100644
--- a/Library/Homebrew/cask/lib/hbc/cli.rb
+++ b/Library/Homebrew/cask/lib/hbc/cli.rb
@@ -152,7 +152,7 @@ module Hbc
Hbc.default_tap.install unless Hbc.default_tap.installed?
Hbc.init if should_init?(command)
run_command(command, *rest)
- rescue CaskError, CaskSha256MismatchError => e
+ rescue CaskError, CaskSha256MismatchError, ArgumentError => e
msg = e.message
msg << e.backtrace.join("\n") if Hbc.debug
onoe msg
diff --git a/Library/Homebrew/cask/lib/hbc/cli/internal_stanza.rb b/Library/Homebrew/cask/lib/hbc/cli/internal_stanza.rb
index 105e946d7..c54db8795 100644
--- a/Library/Homebrew/cask/lib/hbc/cli/internal_stanza.rb
+++ b/Library/Homebrew/cask/lib/hbc/cli/internal_stanza.rb
@@ -44,13 +44,15 @@ module Hbc
:stage_only,
:nested_container,
:uninstall,
- :postflight,
- :uninstall_postflight,
:preflight,
+ :postflight,
+ :uninstall_preflight,
:uninstall_postflight,
]
def self.run(*args)
+ raise ArgumentError, "No stanza given." if args.empty?
+
table = args.include? "--table"
quiet = args.include? "--quiet"
format = :to_yaml if args.include? "--yaml"