aboutsummaryrefslogtreecommitdiffstats
path: root/lib/irb/cmd/nop.rb
diff options
context:
space:
mode:
authorStan Lo <stan.lo@shopify.com>2022-12-08 19:10:19 +0000
committergit <svn-admin@ruby-lang.org>2022-12-08 19:10:23 +0000
commit3956bb859c2442d34ea171db8f92f3e5895c43d9 (patch)
tree4800d4eb49ceadec321f37e644ab98fb1f597aa6 /lib/irb/cmd/nop.rb
parent2cea8e014dbbbb68e4e8be367529b2beae564c54 (diff)
downloadruby-3956bb859c2442d34ea171db8f92f3e5895c43d9.tar.gz
[ruby/irb] Add "show_cmds" command to list all commands'
descriptions (https://github.com/ruby/irb/pull/463) https://github.com/ruby/irb/commit/7e857655ac
Diffstat (limited to 'lib/irb/cmd/nop.rb')
-rw-r--r--lib/irb/cmd/nop.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/irb/cmd/nop.rb b/lib/irb/cmd/nop.rb
index 881a736722..280bfe4677 100644
--- a/lib/irb/cmd/nop.rb
+++ b/lib/irb/cmd/nop.rb
@@ -14,6 +14,17 @@ module IRB
module ExtendCommand
class Nop
+ class << self
+ def category(category = nil)
+ @category = category if category
+ @category
+ end
+
+ def description(description = nil)
+ @description = description if description
+ @description
+ end
+ end
if RUBY_ENGINE == "ruby" && RUBY_VERSION >= "2.7.0"
def self.execute(conf, *opts, **kwargs, &block)