Permalink
Browse files

Return the original Proc when no block is give to #on_extra method.

  • Loading branch information...
1 parent 0c08206 commit 99c1e1395ec4f1d649dd96d05dabcf7a7837cfd3 @voxik committed Sep 17, 2012
Showing with 3 additions and 2 deletions.
  1. +3 −2 kernel/delta/options.rb
View
@@ -232,9 +232,10 @@ def help(&block)
on "-h", "--help", "Show this message", &help
end
- # Stores a block that will be called with unrecognized options
+ # Stores a block that will be called with unrecognized options. If no block
+ # is given, the original Proc is returned.
def on_extra(&block)
- @on_extra = block
+ @on_extra = block || @on_extra
end
# Returns a string representation of the options and doc strings.

0 comments on commit 99c1e13

Please sign in to comment.