diff options
| author | Adam Vandenberg | 2014-04-27 10:57:46 -0700 |
|---|---|---|
| committer | Adam Vandenberg | 2014-04-27 17:05:24 -0700 |
| commit | 161b1ea46024552033b0ebcc2dab9ed6e5efb20c (patch) | |
| tree | 83d14a25d62c8fceb942fa52f349e4310eaf3f05 /Library | |
| parent | 8ebe93ab15901ca0296de6c77e1ee9f6ce5b89f0 (diff) | |
| download | homebrew-161b1ea46024552033b0ebcc2dab9ed6e5efb20c.tar.bz2 | |
brew list --versions --multiple
With --multiple, only list formulae with multiple versions installed.
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Contributions/manpages/brew.1.md | 5 | ||||
| -rw-r--r-- | Library/Homebrew/cmd/list.rb | 1 |
2 files changed, 4 insertions, 2 deletions
diff --git a/Library/Contributions/manpages/brew.1.md b/Library/Contributions/manpages/brew.1.md index 3bfd19e99..be2f8c98c 100644 --- a/Library/Contributions/manpages/brew.1.md +++ b/Library/Contributions/manpages/brew.1.md @@ -227,7 +227,7 @@ Note that these flags should only appear after a command. If provided, `--local` will move them into the user's `~/Applications` folder instead of the system folder. It may need to be created, first. - * `ls, list [--unbrewed] [--versions] [--pinned]` [<formulae>]: + * `ls, list [--unbrewed] [--versions [--multiple]] [--pinned]` [<formulae>]: Without any arguments, list all installed formulae. If <formulae> are given, list the installed files for <formulae>. @@ -238,7 +238,8 @@ Note that these flags should only appear after a command. by Homebrew. If `--versions` is passed, show the version number for installed formulae, - or only the specified formulae if <formulae> are given. + or only the specified formulae if <formulae> are given. With `--multiple`, + only show formulae with multiple versions installed. If `--pinned` is passed, show the versions of pinned formulae, or only the specified (pinned) formulae if <formulae> are given. diff --git a/Library/Homebrew/cmd/list.rb b/Library/Homebrew/cmd/list.rb index c624040ed..8952f4873 100644 --- a/Library/Homebrew/cmd/list.rb +++ b/Library/Homebrew/cmd/list.rb @@ -63,6 +63,7 @@ module Homebrew extend self ARGV.named.map{ |n| HOMEBREW_CELLAR+n }.select{ |pn| pn.exist? } end.each do |d| versions = d.children.select{ |pn| pn.directory? }.map{ |pn| pn.basename.to_s } + next if ARGV.include?('--multiple') && versions.count < 2 puts "#{d.basename} #{versions*' '}" end end |
