Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

Commit

Permalink
brew list --versions [formulae]
Browse files Browse the repository at this point in the history
Add a `--versions` switch to `brew list` that shows all versions found
in the cellar for the selected formulae.
  • Loading branch information
adamv committed Apr 30, 2010
1 parent 77c02d3 commit 083e2a4
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions bin/brew
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,16 @@ begin
dirs -= ['Library', 'Cellar', '.git']
Dir.chdir HOMEBREW_PREFIX
exec 'find', *dirs + %w[-type f ( ! -iname .ds_store ! -iname brew )]
elsif ARGV.flag? '--versions'
if ARGV.named.empty?
to_list = HOMEBREW_CELLAR.children.select { |pn| pn.directory? }
else
to_list = ARGV.named.collect { |n| HOMEBREW_CELLAR+n }.select { |pn| pn.exist? }
end
to_list.each do |d|
versions = d.children.select { |pn| pn.directory? }.collect { |pn| pn.basename.to_s }
puts "#{d.basename} #{versions *' '}"
end
elsif ARGV.named.empty?
ENV['CLICOLOR']=nil
exec 'ls', *ARGV.options<<HOMEBREW_CELLAR if HOMEBREW_CELLAR.exist?
Expand Down

0 comments on commit 083e2a4

Please sign in to comment.