Skip to content

Commit 6194111

Browse files
authored
Update documentation about the new copy command (#1067)
1 parent 03c3658 commit 6194111

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

doc/Index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@ Debugging
186186
Misc
187187
edit Open a file or source location.
188188
measure `measure` enables the mode to measure processing time. `measure :off` disables it.
189+
copy Copy expression output to clipboard
189190
190191
Context
191192
show_doc Look up documentation with RI.

lib/irb/command/copy.rb

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,21 @@
33
module IRB
44
module Command
55
class Copy < Base
6-
category "Workspace"
7-
description "Copy command output to clipboard"
6+
category "Misc"
7+
description "Copy expression output to clipboard"
88

99
help_message(<<~HELP)
10-
Usage: copy [command]
10+
Usage: copy ([expression])
11+
12+
When given:
13+
- an expression, copy the inspect result of the expression to the clipboard.
14+
- no arguments, copy the last evaluated result (`_`) to the clipboard.
15+
16+
Examples:
17+
18+
copy Foo.new
19+
copy User.all.to_a
20+
copy
1121
HELP
1222

1323
def execute(arg)

0 commit comments

Comments
 (0)