2012-08-11 17:22:29 -07:00
|
|
|
class Pry
|
2012-12-25 23:35:17 +02:00
|
|
|
class Command::ExitProgram < Pry::ClassCommand
|
|
|
|
match 'exit-program'
|
2012-08-11 18:26:59 -07:00
|
|
|
group 'Navigating Pry'
|
2013-01-09 22:23:19 +02:00
|
|
|
description 'End the current program.'
|
|
|
|
|
|
|
|
banner <<-'BANNER'
|
|
|
|
Usage: exit-program [--help]
|
|
|
|
Aliases: quit-program
|
|
|
|
!!!
|
|
|
|
|
|
|
|
End the current program.
|
|
|
|
BANNER
|
2012-08-11 18:26:59 -07:00
|
|
|
|
|
|
|
def process
|
|
|
|
Kernel.exit target.eval(arg_string).to_i
|
|
|
|
end
|
2012-08-11 17:22:29 -07:00
|
|
|
end
|
|
|
|
|
2012-12-25 23:35:17 +02:00
|
|
|
Pry::Commands.add_command(Pry::Command::ExitProgram)
|
|
|
|
Pry::Commands.alias_command 'quit-program', 'exit-program'
|
|
|
|
Pry::Commands.alias_command '!!!', 'exit-program'
|
2012-08-11 17:22:29 -07:00
|
|
|
end
|