added --no-pager to binary options, and refactored options

This commit is contained in:
John Mair 2011-06-05 03:59:05 +12:00
parent ffb9670b7f
commit 570ff75cdd
1 changed files with 19 additions and 9 deletions

28
bin/pry
View File

@ -20,9 +20,25 @@ See: `https://github.com/banister` for more information.
}
on :e, :exec, "A line of code to execute in context before the session starts", true
on :f, "Suppress loading of ~/.pryrc"
on "no-color", "Disable syntax highlighting for session"
on "no-plugins", "Suppress loading of plugins."
on "no-pager", "Disable pager for long output" do
Pry.pager = false
end
on "no-color", "Disable syntax highlighting for session" do
Pry.color = false
end
on :f, "Suppress loading of ~/.pryrc" do
# load ~/.pryrc, if not suppressed with -f option
Pry.config.should_load_rc = false
end
on "no-plugins", "Suppress loading of plugins." do
# suppress plugins if given --no-plugins optino
Pry.config.plugins.enabled = false
end
on "simple-prompt", "Enable simple prompt mode" do
Pry.prompt = Pry::SIMPLE_PROMPT
end
@ -50,12 +66,6 @@ end
# invoked via cli
Pry.cli = true
# load ~/.pryrc, if not suppressed with -f option
Pry.config.should_load_rc = !opts.f?
# suppress plugins if given --no-plugins optino
Pry.config.plugins.enabled = false if opts["no-plugins"]
# create the actual context
context = Pry.binding_for(eval(opts[:context]))