Issue #6548 has been updated by jeremyevans0 (Jeremy Evans).


rosenfeld (Rodrigo Rosenfeld Rosas) wrote:
> It is not a matter of respect. I do respect Jim's opinion, but this is how I see this.
> 
> Clearly this is not expected behavior for any script (in Unix, -- means that additional options should be ignored).
> 

More accurately, in most unix programs, "--" denotes that everything after is treated as an argument instead of an option.

For example "fgrep -n -i foo" searches standard input for foo with -n and -i options, while "fgrep -n -- -i foo" searches for -i in foo with -n option.

What this means for rake is that "rake -- --tasks" should treat "--tasks" as a target/task instead of an option.  It doesn't appear to do that ("rake -- --tasks" appears to execute the default task), which may be an issue.

Considering rake is "ruby make", there is an argument to be made that it should operate like make:

$ make -n foo
make: don't know how to make foo
$ make -- -n foo
make: don't know how to make -n

Note that the standard unix "--" behavior is for options handling only, and is unrelated to your example "rake some_task -- some_arg", which doesn't contain options.

> Now if rake was independent from Ruby distribution we should be done and I wouldn't arguee about this decision here.
> 
> But it is part of stdlib, and as so, I think this should be a Ruby core developers decision.
> 
> I don't think it is reasonable to break expecations of how programs should work. I respect Jim's opinion and I'm grateful for all his work, but I just think we should discuss this decision further more. After all rake is bundled with Ruby, it is not just an isolated gem.

I agree with Eric that it should be Jim's decision, unless matz wants to fork rake.
----------------------------------------
Bug #6548: Rake doesn't ignore arguments after --
https://bugs.ruby-lang.org/issues/6548#change-31023

Author: rosenfeld (Rodrigo Rosenfeld Rosas)
Status: Closed
Priority: Normal
Assignee: drbrain (Eric Hodel)
Category: lib
Target version: 2.0.0
ruby -v: ruby 1.9.3p125 (2012-02-16 revision 34643) [x86_64-linux]


I've created this issue first in GitHub before I realized that Rake is now part of stdlib:

https://github.com/jimweirich/rake/issues/115

I'll copy it here:

rake some_task -- some_arg

Raises an error after running some_task:

Don't know how to build task some_arg.


-- 
http://bugs.ruby-lang.org/