From 40f70f3fccbe9128ce7b6e713efb60516dcfbe40 Mon Sep 17 00:00:00 2001 From: Stan Lo Date: Wed, 22 Jan 2025 00:12:28 +0800 Subject: [PATCH] [ruby/irb] Update documentation about the new copy command (https://github.com/ruby/irb/pull/1067) https://github.com/ruby/irb/commit/6194111611 --- lib/irb/command/copy.rb | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/lib/irb/command/copy.rb b/lib/irb/command/copy.rb index b6aee0c3381b4e..93410b878a0ceb 100644 --- a/lib/irb/command/copy.rb +++ b/lib/irb/command/copy.rb @@ -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)