[Rake-devel] Suggestion: allow passing of extra command-line argsto the task

Martin DeMello martindemello at yahoo.com
Tue Jun 15 07:07:07 EDT 2004


--- "Bennett, Patrick" <Patrick.Bennett at inin.com> wrote:
> Wouldn't it be better to define a syntax where arbitrary 'named'
> arguments can be specified? (like make)
> Something like:
> rake clean html html_file=foo.html -dtest -dFOO

I don't like globally naming arguments. How about

rake clean html {file:foo.html template:in.html} test {dir:test1} 

> Rake would then expose all defined parameters to rakefiles as a hash.  
> Any xxx=yyy command line argument would be assumbed to be a name/value
> parameter.  -d could be used as a shortcut way of saying xxxx=true, or
> to simply make it a bit clear (-d html_file=foo.html).

I like the -d idea, but I see the conceptual difference as having global args
like that modify behaviour for all targets, whereas args bound to a particular
target modify just that target. 

> I'm definitely against the multiple file, multiple arguments per file
> approach.  I think it's better to just change rake to allow rakefile
> chaining.  I added a method called 'subdirs' for rakefiles so that a
> rakefile can look like:
> task xxxxx
> task yyy
> 
> subdirs('unit_tests','examples')
> 
> After rake finishes the current file, it then walks through a queue of
> subdirectories (that is modified by subdirs).  It clears out all task
> objects, then looks for a rakefile in the next directory off the queue.

I remember reading some arguments against recursive makefiles, though I admit I
didn't understand them at the time. Anyone?

martin




		
__________________________________
Do you Yahoo!?
Yahoo! Mail - Helps protect you from nasty viruses.
http://promotions.yahoo.com/new_mail


More information about the Rake-devel mailing list