diff options
Diffstat (limited to 'lib/irb/command/force_exit.rb')
-rw-r--r-- | lib/irb/command/force_exit.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/irb/command/force_exit.rb b/lib/irb/command/force_exit.rb new file mode 100644 index 0000000000..c2c5542e24 --- /dev/null +++ b/lib/irb/command/force_exit.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module IRB + # :stopdoc: + + module Command + class ForceExit < Base + category "IRB" + description "Exit the current process." + + def execute(*) + throw :IRB_EXIT, true + rescue UncaughtThrowError + Kernel.exit! + end + end + end + + # :startdoc: +end |