Skip to content

Commit 5af637b

Browse files
committed
Add doc about "echo on assignment"
1 parent 123b7e5 commit 5af637b

File tree

5 files changed

+40
-0
lines changed

5 files changed

+40
-0
lines changed

doc/irb/irb.rd.ja

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,12 @@ irbの使い方は, Rubyさえ知っていればいたって簡単です. 基本
5151
オブジェクトの作成方法を 0 から 3 のいずれかに設定する.
5252
--echo 実行結果を表示する(デフォルト).
5353
--noecho 実行結果を表示しない.
54+
--echo-on-assignment
55+
代入時に実行結果を表示する.
56+
--noecho-on-assignment
57+
代入時に実行結果を表示しない.
58+
--truncate-echo-on-assignment
59+
代入時に省略された実行結果を表示する(デフォルト).
5460
--inspect 結果出力にinspectを用いる.
5561
--noinspect 結果出力にinspectを用いない.
5662
--singleline シングルラインエディタを利用する.

lib/irb.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,12 @@
6464
# when new workspace was created
6565
# --echo Show result (default)
6666
# --noecho Don't show result
67+
# --echo-on-assignment
68+
# Show result on assignment
69+
# --noecho-on-assignment
70+
# Don't show result on assignment
71+
# --truncate-echo-on-assignment
72+
# Show truncated result on assignment (default)
6773
# --inspect Use `inspect' for output
6874
# --noinspect Don't use inspect for output
6975
# --multiline Use multiline editor module

lib/irb/context.rb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,18 @@ def main
274274
# IRB.CurrentContext.echo_on_assignment = true
275275
# a = "omg" * 10
276276
# #=> omgomgomgomgomgomgomgomgomgomg
277+
#
278+
# To set the behaviour of showing on assignment in irb:
279+
#
280+
# IRB.conf[:ECHO_ON_ASSIGNMENT] = :truncate or true or false
281+
#
282+
# or
283+
#
284+
# irb_context.echo_on_assignment = :truncate or true or false
285+
#
286+
# or
287+
#
288+
# IRB.CurrentContext.echo_on_assignment = :truncate or true or false
277289
attr_accessor :echo_on_assignment
278290
# Whether a newline is put before multiline output.
279291
#

lib/irb/lc/help-message

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ Usage: irb.rb [options] [programfile] [arguments]
2222
when new workspace was created
2323
--echo Show result (default)
2424
--noecho Don't show result
25+
--echo-on-assignment
26+
Show result on assignment
27+
--noecho-on-assignment
28+
Don't show result on assignment
29+
--truncate-echo-on-assignment
30+
Show truncated result on assignment (default)
2531
--inspect Use `inspect' for output
2632
--noinspect Don't use inspect for output
2733
--multiline Use multiline editor module

man/irb.1

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,16 @@ Show result (default).
112112
Don't show result.
113113
.Pp
114114
.Pp
115+
.It Fl -echo-on-assignment
116+
Show result on assignment.
117+
.Pp
118+
.It Fl -noecho-on-assignment
119+
Don't show result on assignment.
120+
.Pp
121+
.It Fl -truncate-echo-on-assignment
122+
Show truncated result on assignment (default).
123+
.Pp
124+
.Pp
115125
.It Fl -colorize
116126
Use colorization.
117127
.Pp

0 commit comments

Comments
 (0)