Skip to content

Commit

Permalink
[ruby/irb] Update documentation about the new copy command
Browse files Browse the repository at this point in the history
  • Loading branch information
st0012 authored and tompng committed Jan 22, 2025
1 parent faa6e2a commit 40f70f3
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions lib/irb/command/copy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,21 @@
module IRB
module Command
class Copy < Base
category "Workspace"
description "Copy command output to clipboard"
category "Misc"
description "Copy expression output to clipboard"

help_message(<<~HELP)
Usage: copy [command]
Usage: copy ([expression])
When given:
- an expression, copy the inspect result of the expression to the clipboard.
- no arguments, copy the last evaluated result (`_`) to the clipboard.
Examples:
copy Foo.new
copy User.all.to_a
copy
HELP

def execute(arg)
Expand Down

0 comments on commit 40f70f3

Please sign in to comment.