13

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

jfabre
  • 514
  • 5
  • 13

4 Answers4

26

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
Dylan Markow
  • 123,080
  • 26
  • 284
  • 201
  • Thank you very much. I never saw that -D in --help... and I really like the cat command. I use git bash on windows so i'm not that familiar with all the combos... – jfabre Aug 24 '11 at 21:03
7

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

rake -D

Vasiliy Ermolovich
  • 24,459
  • 5
  • 79
  • 77
  • Thanks you answer is good but the other one is a bit more complete... Normally I would have accepted it. I just can't accept both and had to make a choice. – jfabre Aug 24 '11 at 21:03
2

There's an environment variable you can set:

export RAKE_COLUMNS=200
dwilkins
  • 1,923
  • 1
  • 10
  • 9
  • [See this question for setting the variable on Windows](http://stackoverflow.com/questions/3803581/setting-a-system-environment-variable-from-a-windows-batch-file) – meustrus Apr 07 '16 at 18:50
2

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)

knut
  • 27,320
  • 6
  • 84
  • 112