From aed6bc194ddf6f9fa334827dc8613e179b753cf1 Mon Sep 17 00:00:00 2001 From: Ninan John Date: Thu, 3 Oct 2019 13:39:18 +0530 Subject: [PATCH 1/2] Show correct message when invalid arguments are passed to brew --- Library/Homebrew/cask/cmd.rb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Library/Homebrew/cask/cmd.rb b/Library/Homebrew/cask/cmd.rb index 6d43a05a8a..e329ab6f81 100644 --- a/Library/Homebrew/cask/cmd.rb +++ b/Library/Homebrew/cask/cmd.rb @@ -221,9 +221,14 @@ module Cask usage return if @command.nil? - return if @command == "help" && @args.empty? - raise ArgumentError, "help does not take arguments." + if @command == "help" + return if @args.empty? + + raise ArgumentError, "help does not take arguments." if @args.length + end + + raise ArgumentError, "brew cask does not recognise this command" end def purpose From ea0150f7a324149f81eb9d80f8385b6c2bfecd5b Mon Sep 17 00:00:00 2001 From: Jacob Ford Date: Fri, 4 Oct 2019 14:27:32 -0400 Subject: [PATCH 2/2] Make invalid command error language consistent with brew core --- Library/Homebrew/cask/cmd.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Library/Homebrew/cask/cmd.rb b/Library/Homebrew/cask/cmd.rb index e329ab6f81..3cc255bf69 100644 --- a/Library/Homebrew/cask/cmd.rb +++ b/Library/Homebrew/cask/cmd.rb @@ -228,7 +228,7 @@ module Cask raise ArgumentError, "help does not take arguments." if @args.length end - raise ArgumentError, "brew cask does not recognise this command" + raise ArgumentError, "Unknown Cask command: #{command}" end def purpose