cmd/list: delineate formulae and casks

Listing everything without qualifying which is which is confusing for
some users.

Fixes #10897.
This commit is contained in:
Carlo Cabrera 2021-03-22 05:18:29 +00:00
parent 7e2ba95169
commit 8538970567
No known key found for this signature in database
GPG Key ID: C74D447FC549A1D0

View File

@ -116,8 +116,16 @@ module Homebrew
ls_args << "-r" if args.r?
ls_args << "-t" if args.t?
safe_system "ls", *ls_args, HOMEBREW_CELLAR unless args.cask?
list_casks(args: args) unless args.formula?
ohai "Formulae" if $stdout.tty? && !args.formula?
safe_system "ls", *ls_args, HOMEBREW_CELLAR
unless args.formula?
if $stdout.tty?
puts
ohai "Casks"
end
list_casks(args: args)
end
elsif args.verbose? || !$stdout.tty?
system_command! "find", args: args.named.to_kegs.map(&:to_s) + %w[-not -type d -print], print_stdout: true
else