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