Pretty print known paths

This commit is contained in:
Adam Sanderson 2010-11-10 19:38:20 -08:00
parent dbaa732ae4
commit ea8c0c0b4a
2 changed files with 14 additions and 0 deletions

13
bin/qw
View File

@ -20,6 +20,19 @@ opts = OptionParser.new do |opts|
@editor = editor
end
opts.separator "Additional Commands"
opts.on("--paths", "Prints all repositories and their paths") do |editor|
@qwandry.repositories.each do |label, entries|
puts label
entries.each do |repo|
puts "\t#{repo.path} (#{repo.class.to_s.split('::').last})"
end
puts ""
end
exit(0)
end
opts.on_tail("-h", "--help", "Show this message") do
puts opts
exit

View File

@ -1,6 +1,7 @@
module Qwandry
class Repository
attr_reader :name
attr_reader :path
def initialize(name, path)
@name = name