#!/usr/bin/env ruby $:.unshift File.expand_path '../lib', File.dirname(__FILE__) require 'rubygems' require 'bowl' require 'args_parser' parser = ArgsParser.parse ARGV do arg :port, 'HTTP port', :alias => :p, :default => 8901 arg :help, 'show help', :alias => :h end bin = $0.split('/').last if parser.has_option? :help STDERR.puts "Bowl - Mac/Linux controller for your Application v#{Bowl::VERSION}" STDERR.puts " https://github.com/shokai/bowl" STDERR.puts STDERR.puts parser.help STDERR.puts STDERR.puts "e.g." STDERR.puts " % #{bin} --port 8901" exit 0 end dir = File.expand_path '../lib/bowl/app', File.dirname(__FILE__) puts "start bowl => http://localhost:#{parser[:port]}" system "cd '#{dir}' && rackup config.ru -p #{parser[:port]}"