From 85389705679ffa47b5fed4dc2667ca621d7499bf Mon Sep 17 00:00:00 2001 From: Carlo Cabrera <30379873+carlocab@users.noreply.github.com> Date: Mon, 22 Mar 2021 05:18:29 +0000 Subject: [PATCH] cmd/list: delineate formulae and casks Listing everything without qualifying which is which is confusing for some users. Fixes #10897. --- Library/Homebrew/cmd/list.rb | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Library/Homebrew/cmd/list.rb b/Library/Homebrew/cmd/list.rb index c9cb629aa6..a11b7f21fb 100644 --- a/Library/Homebrew/cmd/list.rb +++ b/Library/Homebrew/cmd/list.rb @@ -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