Commit db625911 authored by Stefan Damm's avatar Stefan Damm

Added flag --pod-versions to list command

parent 333828bd
...@@ -7,7 +7,8 @@ module Pod ...@@ -7,7 +7,8 @@ module Pod
def self.options def self.options
[[ [[
"--update", "Run `pod repo update` before listing", "--update", "Run `pod repo update` before listing",
"--stats", "Show additional stats (like GitHub watchers and forks)" "--stats", "Show additional stats (like GitHub watchers and forks)",
"--pod-versions", "Show latest version of each pod"
]].concat(super) ]].concat(super)
end end
...@@ -17,6 +18,7 @@ module Pod ...@@ -17,6 +18,7 @@ module Pod
def initialize(argv) def initialize(argv)
@update = argv.flag?('update') @update = argv.flag?('update')
@stats = argv.flag?('stats') @stats = argv.flag?('stats')
@pod_versions = argv.flag?('pod-versions')
super super
end end
...@@ -24,7 +26,7 @@ module Pod ...@@ -24,7 +26,7 @@ module Pod
update_if_necessary! update_if_necessary!
sets = SourcesManager.all_sets sets = SourcesManager.all_sets
sets.each { |set| UI.pod(set, :name) } sets.each { |set| UI.pod(set, @pod_versions ? :name_and_version : :name) }
UI.puts "\n#{sets.count} pods were found" UI.puts "\n#{sets.count} pods were found"
end end
......
...@@ -160,6 +160,8 @@ module Pod ...@@ -160,6 +160,8 @@ module Pod
def pod(set, mode = :normal, statistics_provider = nil) def pod(set, mode = :normal, statistics_provider = nil)
if mode == :name if mode == :name
puts_indented set.name puts_indented set.name
elsif mode == :name_and_version
puts_indented "#{set.name} #{set.versions.first.version}"
else else
pod = Specification::Set::Presenter.new(set, statistics_provider) pod = Specification::Set::Presenter.new(set, statistics_provider)
title("\n-> #{pod.name} (#{pod.version})".green, '', 1) do title("\n-> #{pod.name} (#{pod.version})".green, '', 1) do
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment