开发者

rake --tasks full description (not cut)

Maybe it's one 开发者_运维技巧of those code 18,

but when I run rake -T on my Rakefile, the long descriptions of my tasks are always cut. Is there any way to display the full description without having to make the desc shorter?

Thanks


The format is slightly different (description starts on the next line instead of as a comment on the current line), but this will give you the full descriptions:

rake -D

Also, if you really want the other format, you can pipe the output to cat instead:

rake -T | cat


-D, --describe [PATTERN] Describe the tasks (matching optional PATTERN), then exit.

rake -D


Three solutions:

1) You may define your own '-T'

task :longT do
  app = Rake.application
  app.tasks.each{|task|
    puts "%-20s  # %s" % [task.name, task.comment] if task.comment
  }
end

2) fool, there is no tty:

Rake.application.tty_output= false    

3) Modify a rake command

module Rake
  class Application
    def truncate_output?
      #tty_output? || ENV['RAKE_COLUMNS']
      false
    end
  end
end

I would recommend version 2)

(Tested with rake-0.8.7)


There's an environment variable you can set:

export RAKE_COLUMNS=200
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜