diff --git a/Library/Homebrew/cmd/list.rb b/Library/Homebrew/cmd/list.rb index 405348e03bde38156d9857ec3baa5388e06387fc..81a5caf4dfddedae634fabf4f8dfabe07b197a3e 100644 --- a/Library/Homebrew/cmd/list.rb +++ b/Library/Homebrew/cmd/list.rb @@ -1,4 +1,5 @@ require "metafiles" +require "formula" module Homebrew def list @@ -16,8 +17,21 @@ module Homebrew if ARGV.include? '--pinned' or ARGV.include? '--versions' filtered_list elsif ARGV.named.empty? - ENV['CLICOLOR'] = nil - exec 'ls', *ARGV.options_only << HOMEBREW_CELLAR + if ARGV.include? "--full-name" + full_names = Formula.installed.map(&:full_name).sort do |a, b| + if a.include?("/") && !b.include?("/") + 1 + elsif !a.include?("/") && b.include?("/") + -1 + else + a <=> b + end + end + puts_columns full_names + else + ENV['CLICOLOR'] = nil + exec 'ls', *ARGV.options_only << HOMEBREW_CELLAR + end elsif ARGV.verbose? or not $stdout.tty? exec "find", *ARGV.kegs.map(&:to_s) + %w[-not -type d -print] else