2

I know in Ant / Nant you can pass an argument like -projecthelp to get a list of avaialbe targets with descriptions.

Is there a similar command-line argument for doing this with a rakefile's tasks?

Also is there a way to generate documentation from the rakefile itself?

leeand00
  • 25,510
  • 39
  • 140
  • 297

2 Answers2

2
rake -P

Displays tasks and dependencies.

rake -T

Displays tasks and descriptions

rake -T [PATTERN]

Displays tasks and descriptions filtered by that PATTERN. A pattern might be anything from namespace:task_name without the leading rake and without the prepended # comment (your desc from above a task/method).

# Example
namespace :example do
        # ^ searchable
    desc "Some task doing things"
    task :example do
       # ^ searchable
        puts "Hello world"
    end
end
kaiser
  • 21,817
  • 17
  • 90
  • 110
2

rake -T lists tasks rake --help shows other options

They are not necessarily 'targets' in Rakefiles though, they are just actions. Look at RDoc for documenting Ruby code

Chris Farmiloe
  • 13,935
  • 5
  • 48
  • 57