about summary refs log tree commit homepage
path: root/bin/local-openid
diff options
context:
space:
mode:
Diffstat (limited to 'bin/local-openid')
-rwxr-xr-xbin/local-openid18
1 files changed, 17 insertions, 1 deletions
diff --git a/bin/local-openid b/bin/local-openid
index 7fc6b33..4b8f315 100755
--- a/bin/local-openid
+++ b/bin/local-openid
@@ -1,3 +1,19 @@
 #!/usr/bin/env ruby
 require 'local_openid'
-LocalOpenID.run!
+require 'optparse'
+require 'socket'
+BasicSocket.do_not_reverse_lookup = true
+opts = {
+  :server => 'webrick', # webrick is standard, and plenty fast enough
+}
+OptionParser.new { |op|
+  op.on('-s <mongrel|thin|webrick>') { |v| opts[:server] = v }
+  op.on('-p port')   { |val| opts[:port] = val.to_i }
+  op.on('-o addr')   { |val| opts[:bind] = val }
+  op.on('-h', '--help', 'Show this message') do
+    puts op.to_s
+    exit
+  end
+}.parse!(ARGV)
+
+LocalOpenID.run!(opts)