summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyrylo Silin <kyrylosilin@gmail.com>2012-08-23 22:45:42 +0300
committerKyrylo Silin <kyrylosilin@gmail.com>2012-11-21 04:57:43 +0200
commitd525f69eff4dda47594dba89bbe0a41efef34154 (patch)
treef6ae86d8cbb7ba16a28cd4f2f26b4ad1a3334139
parentd8679a8ff8af24865383f31ed777840e62118350 (diff)
downloadpry-d525f69eff4dda47594dba89bbe0a41efef34154.tar.gz
Refactor ClassCommand#slop
Do not create unwanted Proc, because there is no real reason for it. Signed-off-by: Kyrylo Silin <kyrylosilin@gmail.com>
-rw-r--r--lib/pry/command.rb13
1 files changed, 6 insertions, 7 deletions
diff --git a/lib/pry/command.rb b/lib/pry/command.rb
index 267ac58d..4337b3bd 100644
--- a/lib/pry/command.rb
+++ b/lib/pry/command.rb
@@ -626,15 +626,14 @@ class Pry
# Return an instance of Slop::Commands that can parse either subcommands
# or the options that this command accepts.
def slop
- opts = proc do |opt|
- opt.banner(unindent(self.class.banner))
- options(opt)
- opt.on(:h, :help, "Show this message.")
- end
-
Slop::Commands.new do |cmd|
subcommands(cmd)
- cmd.default { |opt| opts.call(opt) }
+
+ cmd.default do |opt|
+ opt.banner(unindent(self.class.banner))
+ options(opt)
+ opt.on(:h, :help, "Show this message.")
+ end
end
end