From e468d9f49ca34f713c030c623f655a40370e186d Mon Sep 17 00:00:00 2001 From: aycabta Date: Sat, 29 Aug 2020 20:48:25 +0900 Subject: [ruby/irb] Add OMIT_ON_ASSIGNMENT Omit the results evaluated at assignment if they are too long. The behavior of ECHO_ON_ASSIGNMENT being on by default is hard to understand, so I change it to off by default. Instead, we turn OMIT_ON_ASSIGNMENT on by default. The result is displayed on assignment, but it will always be short and within one line of the screen. https://github.com/ruby/irb/commit/c5ea79d5ce --- lib/irb/init.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/irb/init.rb') diff --git a/lib/irb/init.rb b/lib/irb/init.rb index da40bee5e1..44383609bd 100644 --- a/lib/irb/init.rb +++ b/lib/irb/init.rb @@ -52,6 +52,7 @@ module IRB # :nodoc: @CONF[:IGNORE_EOF] = false @CONF[:ECHO] = nil @CONF[:ECHO_ON_ASSIGNMENT] = nil + @CONF[:OMIT_ON_ASSIGNMENT] = nil @CONF[:VERBOSE] = nil @CONF[:EVAL_HISTORY] = nil @@ -177,6 +178,10 @@ module IRB # :nodoc: @CONF[:ECHO_ON_ASSIGNMENT] = true when "--noecho-on-assignment" @CONF[:ECHO_ON_ASSIGNMENT] = false + when "--omit-on-assignment" + @CONF[:OMIT_ON_ASSIGNMENT] = true + when "--noomit-on-assignment" + @CONF[:OMIT_ON_ASSIGNMENT] = false when "--verbose" @CONF[:VERBOSE] = true when "--noverbose" -- cgit v1.2.3