#!/usr/bin/env ruby require 'fake_sqs' require 'fake_sqs/web_interface' require 'optparse' app = FakeSQS::WebInterface parser = OptionParser.new do |o| o.on "-p", "--port PORT", Integer, "Port to use (default: 4567)" do |port| app.set :port, port end o.on "-o", "--bind HOST", "Host to bind to (default: 0.0.0.0)" do |bind| app.set :bind, bind end o.on "-s", "--server SERVER", ['thin', 'mongrel', 'webrick'], "Server to use: thin, mongrel or webrick" do |server| app.set :server, server end o.on "-v", "--verbose", "Shows input parameters and output XML" do require 'fake_sqs/show_output' app.use FakeSQS::ShowOutput end o.on_tail "--version", "Shows the version" do puts "fake_sqs version #{FakeSQS::VERSION}" exit end o.on_tail "-h", "--help", "Shows this help page" do puts o exit end end parser.parse! app.run!