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
def self.options
[[
"--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)
end
......@@ -17,6 +18,7 @@ module Pod
def initialize(argv)
@update = argv.flag?('update')
@stats = argv.flag?('stats')
@pod_versions = argv.flag?('pod-versions')
super
end
......@@ -24,7 +26,7 @@ module Pod
update_if_necessary!
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"
end
......
......@@ -160,6 +160,8 @@ module Pod
def pod(set, mode = :normal, statistics_provider = nil)
if mode == :name
puts_indented set.name
elsif mode == :name_and_version
puts_indented "#{set.name} #{set.versions.first.version}"
else
pod = Specification::Set::Presenter.new(set, statistics_provider)
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