diff --git a/Library/Homebrew/cmd/list.rb b/Library/Homebrew/cmd/list.rb index 43d667ddef..6dc0636dc7 100644 --- a/Library/Homebrew/cmd/list.rb +++ b/Library/Homebrew/cmd/list.rb @@ -8,7 +8,10 @@ module Homebrew # Unbrewed uses the PREFIX, which will exist # Things below use the CELLAR, which doesn't until the first formula is installed. - return unless HOMEBREW_CELLAR.exist? + unless HOMEBREW_CELLAR.exist? + raise NoSuchKegError.new(ARGV.named.first) if ARGV.named.any? + return + end if ARGV.include? '--pinned' or ARGV.include? '--versions' filtered_list