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