# File lib/rake/application.rb, line 209
209:     def display_tasks_and_comments
210:       displayable_tasks = tasks.select { |t|
211:         t.comment && t.name =~ options.show_task_pattern
212:       }
213:       case options.show_tasks
214:       when :tasks
215:         width = displayable_tasks.collect { |t| t.name_with_args.length }.max || 10
216:         max_column = truncate_output? ? terminal_width - name.size - width - 7 : nil
217: 
218:         displayable_tasks.each do |t|
219:           printf "#{name} %-#{width}s  # %s\n",
220:             t.name_with_args, max_column ? truncate(t.comment, max_column) : t.comment
221:         end
222:       when :describe
223:         displayable_tasks.each do |t|
224:           puts "#{name} #{t.name_with_args}"
225:           t.full_comment.split("\n").each do |line|
226:             puts "    #{line}"
227:           end
228:           puts
229:         end
230:       when :lines
231:         displayable_tasks.each do |t|
232:           t.locations.each do |loc|
233:             printf "#{name} %-30s %s\n",t.name_with_args, loc
234:           end
235:         end
236:       else
237:         fail "Unknown show task mode: '#{options.show_tasks}'"
238:       end
239:     end