Permalink
Browse files

fix display of usage message

  • Loading branch information...
1 parent d1f5f6f commit 5f0e59eaa00912d1f785872327eec9ffb13401cc @benatkin committed Oct 5, 2011
Showing with 2 additions and 1 deletion.
  1. +2 −1 weaky.rb
View
3 weaky.rb
@@ -9,14 +9,15 @@
$couch_url = nil
if ENV['COUCH_URL']
$couch_url = ENV['COUCH_URL']
-elsif
+elsif ARGV[0]
$couch_url = 'http://' + ARGV[0].to_s.gsub(/^http:\/\//,"")
else
puts 'Usage:'
puts ' ruby weaky.rb http://localhost:5984/weaky'
puts ' ruby weaky.rb localhost:5984/weaky'
puts
puts ' Or set the environment variable COUCH_URL to the database URL'
+ exit 1
end
$weaky = CouchRest.database!($couch_url)

0 comments on commit 5f0e59e

Please sign in to comment.