Namely, add support for multiple arguments for the `-I` option. For
example:
% pry -Ilib:../code/src
Where `:` is the delimiter for paths. In the example above `./lib` and
`../code/src` directories will be added to $LOAD_PATH array.
Also, there was a bug in Slop with respect to parsing of "fuzzy options
with arguments"[1]. It is fixed now, so the next version of Slop will
indirectly resolve our issue #674 (-r/--require doesn't behave like
irb's)[2].
And finally, wrap some very long lines in the "cli.rb" (this is just a
cosmetic change).
[1]: https://github.com/injekt/slop/issues/74
[2]: https://github.com/pry/pry/issues/674
Signed-off-by: Kyrylo Silin <kyrylosilin@gmail.com>
Options passed to pry executable, i.e '-h' were not removed from ARGV
causing pry to attempt to open the "-h" file to load it through the REPL.
Fixed by removing flags from ARGV during option processing.
This is an interesting trick as it processes your file as if it
was user input in an interactive session. As a result, all Pry
commands are available, and they are executed non-interactively. Furthermore
the session becomes interactive when the repl loop processes a
'make-interactive' command in the file. The session also becomes
interactive when an exception is encountered, enabling you to fix
the error before returning to non-interactive processing with the
'make-non-interactive' command.
Plugins can define their own command line options by having a lib/plugin_name/cli.rb file. If this file exists
it is loaded immediately before command line options are processed. The contents of the file should be along the lines of:
Pry::CLI.add_options do
on "my-option", "My first option!" do
puts "I just defined an option!"
end
end