Navigation Menu

Skip to content

Commit

Permalink
cleanup on Docopt::docopt
Browse files Browse the repository at this point in the history
  • Loading branch information
johari committed Aug 23, 2012
1 parent 7e06795 commit d58bda5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/docopt.rb
Expand Up @@ -633,7 +633,7 @@ def extras(help, version, options, doc)
end

def docopt(doc, params={})
default = { :version => nil, :argv => nil, :help => true }
default = {:version => nil, :argv => nil, :help => true}
params = default.merge(params)
params[:argv] = ARGV if !params[:argv]

Expand All @@ -644,7 +644,7 @@ def docopt(doc, params={})
extras(params[:help], params[:version], argv, doc)

matched, left, collected = pattern.fix().match(argv)
collected = [] if !collected
collected ||= []

if matched and (!left or left.count == 0)
ret = {}
Expand Down

0 comments on commit d58bda5

Please sign in to comment.