-
Notifications
You must be signed in to change notification settings - Fork 0
/
sabbath
executable file
·42 lines (31 loc) · 1.04 KB
/
sabbath
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/usr/bin/env ruby -rubygems
require File.join(File.dirname(__FILE__), '..', 'lib', 'sabbath')
require 'optparse'
options = {}
options[:port] = 11300
options[:host] = 'localhost'
options[:web_port] = 4848
options[:web_host] = '0.0.0.0'
parser = OptionParser.new do |opts|
opts.banner = "Usage: sabbath [options]"
opts.separator ""
opts.separator "Options:"
opts.on("-p[OPTIONAL]", "--port", "Port (default: #{options[:port]})") do |v|
options[:port] = v
end
opts.on("-h[OPTIONAL]", "--host", "Host (default: #{options[:host]})") do |v|
options[:host] = v
end
opts.on("-P[OPTIONAL]", "--web-port", "Web port (default: #{options[:web_port]})") do |v|
options[:port] = v
end
opts.on("-H[OPTIONAL]", "--web-host", "Web host (default: #{options[:web_host]})") do |v|
options[:host] = v
end
opts.on("-R[OPTIONAL]", "--rackup", "Rackup file (optional)") do |v|
options[:rackup] = v
end
opts.on_tail("-h", "--help", "Show this help message.") { puts opts; exit }
end
parser.parse!(ARGV)
Sabbath.new(options).start