Created
September 4, 2013 17:49
-
-
Save lululau/6440345 to your computer and use it in GitHub Desktop.
parse_options method in pry/cli.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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