Created
March 17, 2011 10:20
-
-
Save banister/874115 to your computer and use it in GitHub Desktop.
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
OptionParser.new do |opts| | |
opts.banner = %{Usage: show-doc [OPTIONS] [METH] | |
Show the comments above method METH. Tries instance methods first and then methods by default. | |
e.g show-doc hello_method | |
-- | |
} | |
opts.on("-M", "--instance-methods", "Operate on instance methods.") do | |
options[:M] = true | |
end | |
opts.on("-m", "--methods", "Operate on methods.") do | |
options[:m] = true | |
end | |
opts.on("-c", "--context CONTEXT", "Select object context to run under.") do |context| | |
target = Pry.binding_for(target.eval(context)) | |
end | |
opts.on_tail("-h", "--help", "This message.") do | |
output.puts opts | |
options[:h] = true | |
end | |
end.order(args) do |v| | |
meth_name = v | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment