command: fail early if no command is given

Closes Homebrew/homebrew#44450.

Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
This commit is contained in:
Baptiste Fontaine 2015-09-29 15:39:08 +02:00
parent e0f9994542
commit f629bb4e0f

View File

@ -1,5 +1,6 @@
module Homebrew module Homebrew
def command def command
abort "This command requires a command argument" if ARGV.empty?
cmd = ARGV.first cmd = ARGV.first
cmd = HOMEBREW_INTERNAL_COMMAND_ALIASES.fetch(cmd, cmd) cmd = HOMEBREW_INTERNAL_COMMAND_ALIASES.fetch(cmd, cmd)