The --backtrace-limit option was added in #8661 but it is not currently supported in the RUBYOPT environment variable, which appears to be a mistake. Unlike other long options which are not allowed in RUBYOPT (e.g. --copyright, --version, --dump and --help) it does not cause the interpreter to terminate, and cannot cause harm if read from the environment. During the initial discussion about the --backtrace-limit feature, Matz suggested that he expected RUBYOPT to allow this option.
My main goal is to allow RUBYOPT to support --backtrace-limit.
I am happy to remove the ability to say --backtrace-limit=-1 from my patch if it’s undesirable, but since -1 is already a meaningful value for the backtrace limit, it seems useful and unsurprising to allow it. For example, this makes it possible to use RUBYOPT to restore the default backtrace limit by saying RUBYOPT="--backtrace-limit=-1" ruby --backtrace-limit=5.
Basically accepted, including --backtrace-limit=-1. But as far as I understand, command line options are (and should be) higher precedence than RUBYOPT.