From: merch-redmine@jeremyevans.net
To: ruby-core@ruby-lang.org
Subject: [ruby-core:102055] [Ruby master Feature#17479] Enable to get "--backtrace-limit" value by "$-B"
Date: Wed, 13 Jan 2021 07:10:17 +0000 (UTC) [thread overview]
Message-ID: <redmine.journal-89911.20210113071017.47810@ruby-lang.org> (raw)
In-Reply-To: redmine.issue-17479.20201227100348.47810@ruby-lang.org
Issue #17479 has been updated by jeremyevans0 (Jeremy Evans).
matz (Yukihiro Matsumoto) wrote in #note-4:
> I am OK with introducing a way to get the limit. But I am strongly opposed to `$-B`. Any other idea?
If we are OK with this being a constant and not a variable, `RUBY_BACKTRACE_LIMIT`.
----------------------------------------
Feature #17479: Enable to get "--backtrace-limit" value by "$-B"
https://bugs.ruby-lang.org/issues/17479#change-89911
* Author: neg_hide (Hidenori Negishi)
* Status: Open
* Priority: Normal
----------------------------------------
# Background
There is currently no way to get "--backtrace-limit" value when outputing backtraces from my script, so I have to ignore this value and output backtraces.
In order to be able to output according to "--backtrace-limit" value, I need a API to get this value from the Ruby side.
# Proposal
I propose a readonly built-in variable "$-B" to get "--backtrace-limit" value.
``` ruby
# ruby --backtrace-limit=3 script.rb
puts $-B # => 3
```
--
https://bugs.ruby-lang.org/
next prev parent reply other threads:[~2021-01-13 7:10 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-27 10:03 [ruby-core:101734] [Ruby master Feature#17479] Enable to get "--backtrace-limit" value by "$-B" nodai2h.ITC
2020-12-27 11:06 ` [ruby-core:101739] " mame
2020-12-27 16:03 ` [ruby-core:101745] " eregontp
2020-12-28 14:47 ` [ruby-core:101782] " nodai2h.ITC
2021-01-13 5:50 ` [ruby-core:102049] " matz
2021-01-13 7:10 ` merch-redmine [this message]
2021-01-14 13:20 ` [ruby-core:102092] " eregontp
2021-01-15 14:44 ` [ruby-core:102105] " nodai2h.ITC
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.ruby-lang.org/en/community/mailing-lists/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=redmine.journal-89911.20210113071017.47810@ruby-lang.org \
--to=ruby-core@ruby-lang.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).