diff options
author | Stan Lo <stan.lo@shopify.com> | 2022-12-08 19:10:19 +0000 |
---|---|---|
committer | git <svn-admin@ruby-lang.org> | 2022-12-08 19:10:23 +0000 |
commit | 3956bb859c2442d34ea171db8f92f3e5895c43d9 (patch) | |
tree | 4800d4eb49ceadec321f37e644ab98fb1f597aa6 /lib/irb/cmd/subirb.rb | |
parent | 2cea8e014dbbbb68e4e8be367529b2beae564c54 (diff) | |
download | ruby-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/subirb.rb')
-rw-r--r-- | lib/irb/cmd/subirb.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/irb/cmd/subirb.rb b/lib/irb/cmd/subirb.rb index 4d113c5bd7..43364f1393 100644 --- a/lib/irb/cmd/subirb.rb +++ b/lib/irb/cmd/subirb.rb @@ -30,24 +30,36 @@ module IRB end class IrbCommand < MultiIRBCommand + category "IRB" + description "Start a child IRB." + def execute(*obj) IRB.irb(nil, *obj) end end class Jobs < MultiIRBCommand + category "IRB" + description "List of current sessions." + def execute IRB.JobManager end end class Foreground < MultiIRBCommand + category "IRB" + description "Switches to the session of the given number." + def execute(key) IRB.JobManager.switch(key) end end class Kill < MultiIRBCommand + category "IRB" + description "Kills the session with the given number." + def execute(*keys) IRB.JobManager.kill(*keys) end |