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

Gavin Sinclair gsinclair at soyabean.com.au
Mon Jun 14 07:06:31 EDT 2004

On Monday, June 14, 2004, 8:16:55 PM, Martin wrote:

> --- Gavin Sinclair <gsinclair at soyabean.com.au> wrote:

>> Rake is then called like this:
>>   $ rake html                 # default input, as usual
>>   $ rake html -- other.txt    # use specified input file
>> I like the fact that multiple arguments to 'rake' will result in
>> multiple tasks being executed.  Using '--' is a standard way to
>> indicate that no more arguments should be parsed.  Therefore, we can
>> have the normal Rake behaviour, plus we can have arguments being
>> passed to tasks.

> How about per-target arguments, then? Maybe something like

> rake clean html -f other.txt \; test -f test.in \; make make-install

> where if you have a -flag, anything from there to the \; is arguments for that
> target.

That seems like overkill.  The command-line syntax is cumbersome and
unappealing, and the feature is unnecessary.  No-one ever *needs* to
put multiple targets in one command; that's just a convenience.  So
it's not something that needs to be supported to the hilt.

What I'm getting at is this.  If rake did support the CL syntax you
describe, I would still do this instead for clarity:

  rake clean
  rake html -f other.txt
  rake test -f test.in
  rake make
  rake make-install

Note: yes, the last two could be combined.

But looking at the above, I think the addition of -f does serve to
visually distinguish between the target and its arguments.

Conclusion: I like the -f idea, but see no need to introduce the \;.


More information about the Rake-devel mailing list