mirror of
https://github.com/pry/pry.git
synced 2022-11-09 12:35:05 -05:00
added --no-history option to pry binary
This commit is contained in:
parent
d7dde63ec2
commit
db649858af
1 changed files with 15 additions and 12 deletions
27
bin/pry
27
bin/pry
|
@ -15,14 +15,19 @@ end
|
||||||
opts = Slop.parse(:help => true, :multiple_switches => false) do
|
opts = Slop.parse(:help => true, :multiple_switches => false) do
|
||||||
banner %{Usage: pry [OPTIONS]
|
banner %{Usage: pry [OPTIONS]
|
||||||
Start a Pry session.
|
Start a Pry session.
|
||||||
See: `https://github.com/banister` for more information.
|
See: `https://github.com/pry` for more information.
|
||||||
|
Copyright (c) 2011 John Mair (banisterfiend)
|
||||||
--
|
--
|
||||||
}
|
}
|
||||||
|
|
||||||
on :e, :exec, "A line of code to execute in context before the session starts", true
|
on :e, :exec, "A line of code to execute in context before the session starts", true
|
||||||
|
|
||||||
on "no-pager", "Disable pager for long output" do
|
on "no-pager", "Disable pager for long output" do
|
||||||
Pry.pager = false
|
Pry.config.pager = false
|
||||||
|
end
|
||||||
|
|
||||||
|
on "no-history", "Disable history loading" do
|
||||||
|
Pry.config.history.should_load = false
|
||||||
end
|
end
|
||||||
|
|
||||||
on "no-color", "Disable syntax highlighting for session" do
|
on "no-color", "Disable syntax highlighting for session" do
|
||||||
|
@ -39,7 +44,14 @@ See: `https://github.com/banister` for more information.
|
||||||
Pry.config.plugins.enabled = false
|
Pry.config.plugins.enabled = false
|
||||||
end
|
end
|
||||||
|
|
||||||
on "installed-plugins", "List installed plugins."
|
on "installed-plugins", "List installed plugins." do
|
||||||
|
puts "Installed Plugins:"
|
||||||
|
puts "--"
|
||||||
|
Pry.locate_plugins.each do |plugin|
|
||||||
|
puts "#{plugin.name}".ljust(18) + plugin.spec.summary
|
||||||
|
end
|
||||||
|
exit
|
||||||
|
end
|
||||||
|
|
||||||
on "simple-prompt", "Enable simple prompt mode" do
|
on "simple-prompt", "Enable simple prompt mode" do
|
||||||
Pry.prompt = Pry::SIMPLE_PROMPT
|
Pry.prompt = Pry::SIMPLE_PROMPT
|
||||||
|
@ -65,15 +77,6 @@ See: `https://github.com/banister` for more information.
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
if opts["installed-plugins"]
|
|
||||||
puts "Installed Plugins:"
|
|
||||||
puts "--"
|
|
||||||
Pry.locate_plugins.each do |plugin|
|
|
||||||
puts "#{plugin.name}".ljust(18) + plugin.spec.summary
|
|
||||||
end
|
|
||||||
exit
|
|
||||||
end
|
|
||||||
|
|
||||||
# invoked via cli
|
# invoked via cli
|
||||||
Pry.cli = true
|
Pry.cli = true
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue