diff options
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/local-openid | 18 |
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) |