Skip to content

Instantly share code, notes, and snippets.

@lululau
Created September 4, 2013 17:49
Show Gist options
  • Save lululau/6440345 to your computer and use it in GitHub Desktop.
Save lululau/6440345 to your computer and use it in GitHub Desktop.
parse_options method in pry/cli.rb
def parse_options(args=ARGV.dup)
unless options
raise NoOptionsError, "No command line options defined! Use Pry::CLI.add_options to add command line options."
end
self.input_args = args
opts = Slop.parse!(args, :help => true, :multiple_switches => false, &options)
# Option processors are optional.
if option_processors
option_processors.each { |processor| processor.call(opts) }
end
self
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment