[ruby-core:92052] [Ruby trunk Bug#15738] RUBYOPT disables have precedence over the command line

From: eregontp@...
Date: 2019-03-29 18:15:44 UTC
List: ruby-core #92052
Issue #15738 has been reported by Eregon (Benoit Daloze).

----------------------------------------
Bug #15738: RUBYOPT disables have precedence over the command line
https://bugs.ruby-lang.org/issues/15738

* Author: Eregon (Benoit Daloze)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: ruby 2.6.2p47 (2019-03-13 revision 67232) [x86_64-linux]
* Backport: 2.4: UNKNOWN, 2.5: UNKNOWN, 2.6: UNKNOWN
----------------------------------------
From #15736:

It seems unexpected that the command line argument doesn't override the RUBYOPT options:

```
$ RUBYOPT=--disable-gems ruby --enable=gems -e 'p defined?(Gem)'
nil
```

That seems a bug. I would expect the command line arguments always override `RUBYOPT` arguments.

This:
```
$ ruby --disable=gems --enable=gems -e 'p defined?(Gem)'     
"constant"
$ ruby --enable=gems --disable=gems -e 'p defined?(Gem)'
nil
```
works as expected.




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

Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>

In This Thread

Prev Next