Forum: Ruby-core [Backport 200 - Backport #7981][Open] ruby does not respect --

Posted by Michal Papis (mpapis)
on 2013-02-28 00:41
(Received via mailing list)
Issue #7981 has been reported by mpapis (Michal Papis).

----------------------------------------
Backport #7981: ruby does not respect --
https://bugs.ruby-lang.org/issues/7981

Author: mpapis (Michal Papis)
Status: Open
Priority: Low
Assignee:
Category:
Target version:


in `ruby --help` I have found:

    Usage: ruby [switches] [--] [programfile] [arguments]

so I have tried this example:

    $ echo 'puts :ok' | ruby -- --params
    > ruby: No such file or directory -- --params (LoadError)

I have assumed that `[argumments]` are independent from `[programfile]`

In the current state of code the help message should be:

    Usage: ruby [switches] [--] [programfile [arguments]]

But I would prefer that it would be fixed and anything after `[--]` that 
is not program gets ignored, so we can use the shell style:

    $ echo 'echo "args:$*:"' | bash -s -- --params
    > args:--params:
Posted by Nobuyoshi Nakada (nobu)
on 2013-02-28 06:50
(Received via mailing list)
Issue #7981 has been updated by nobu (Nobuyoshi Nakada).

Description updated


----------------------------------------
Feature #7981: ruby does not respect --
https://bugs.ruby-lang.org/issues/7981#change-37184

Author: mpapis (Michal Papis)
Status: Open
Priority: Low
Assignee:
Category:
Target version:


=begin
in ((%ruby --help%)) I have found:

    Usage: ruby [switches] [--] [programfile] [arguments]

so I have tried this example:

    $ echo 'puts :ok' | ruby -- --params
    > ruby: No such file or directory -- --params (LoadError)

I have assumed that ((%[argumments]%)) are independent from 
((%[programfile]%))

In the current state of code the help message should be:

    Usage: ruby [switches] [--] [programfile [arguments]]

But I would prefer that it would be fixed and anything after ((%[--]%)) 
that is not program gets ignored, so we can use the shell style:

    $ echo 'echo "args:$*:"' | bash -s -- --params
    > args:--params:
=end
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.