mirror of
https://github.com/pry/pry.git
synced 2022-11-09 12:35:05 -05:00
Send pry into interactive mode after running with -i
This commit is contained in:
parent
ad999c40dd
commit
b1a5adfbb3
2 changed files with 11 additions and 0 deletions
|
@ -143,6 +143,10 @@ Copyright (c) 2013 John Mair (banisterfiend)
|
|||
Pry.plugins[plugin_name].disable!
|
||||
end
|
||||
|
||||
on :i, "interactive", "Go interactive after execution" do
|
||||
Pry.config.exit_interactive = true
|
||||
end
|
||||
|
||||
on "no-plugins", "Suppress loading of plugins." do
|
||||
Pry.config.should_load_plugins = false
|
||||
end
|
||||
|
@ -206,6 +210,9 @@ end.process_options do |opts|
|
|||
if Pry::CLI.input_args.any? && Pry::CLI.input_args != ["pry"]
|
||||
full_name = File.expand_path(Pry::CLI.input_args.first)
|
||||
Pry.load_file_through_repl(full_name)
|
||||
if Pry.config.exit_interactive
|
||||
Pry.toplevel_binding.pry
|
||||
end
|
||||
exit
|
||||
end
|
||||
|
||||
|
|
|
@ -69,6 +69,10 @@ class Pry
|
|||
# Pry.config.exception_whitelist = [SystemExit, SignalException]
|
||||
attr_accessor :exception_whitelist
|
||||
|
||||
# Send Pry into interactive mode after finishing execution
|
||||
# @return [Boolean]
|
||||
attr_accessor :exit_interactive
|
||||
|
||||
# @return [Fixnum] The number of lines of context to show before and after
|
||||
# exceptions, etc.
|
||||
# @example
|
||||
|
|
Loading…
Reference in a new issue