Permalink
Browse files

Merge pull request #127 from thinkerbot/fix_tilt_list

Fix --list option for bin/tilt
  • Loading branch information...
2 parents be571e6 + 2a3fe35 commit 559573bc07b1a139419c8219c1075bbd52cf4cd9 @rtomayko committed Jan 9, 2012
Showing with 5 additions and 3 deletions.
  1. +5 −3 bin/tilt
View
@@ -44,9 +44,11 @@ ARGV.options do |o|
# list all available template engines
o.on("-l", "--list") do
groups = {}
- Tilt.mappings.each do |pattern,engine|
- key = engine.name.split('::').last.sub(/Template$/, '')
- (groups[key] ||= []) << pattern
+ Tilt.mappings.each do |pattern,engines|
+ engines.each do |engine|
+ key = engine.name.split('::').last.sub(/Template$/, '')
+ (groups[key] ||= []) << pattern
+ end
end
groups.sort { |(k1,v1),(k2,v2)| k1 <=> k2 }.each do |engine,files|
printf "%-15s %s\n", engine, files.sort.join(', ')

0 comments on commit 559573b

Please sign in to comment.