1

Right now I can do

rake report shipment_id=5

rake report do
  id = ENV['shipment_id]
end

However I want to simplify the interace to the user by having

rake report 5

How do I do that in rake?

Last resort would be to use ruby and then call rake internally but I want to check if I am missing some feature of rake?

Nick Vanderbilt
  • 36,724
  • 29
  • 83
  • 106
  • This is pretty close to what you want (but not exactly): http://stackoverflow.com/questions/825748/how-do-i-pass-command-line-arguments-to-a-rake-task/825832#825832 – Brian Nov 23 '10 at 17:07

1 Answers1

2

This could be useful: Rails Rake: How to pass in arguments to a task with :environment

Although its only for newer versions of rake.

Community
  • 1
  • 1
Matthew Rathbone
  • 8,144
  • 7
  • 49
  • 79