Sha256: 698187fb602e451ac5b8ca45bd0d12b0b7bde8dce24d6a20fb38277bdc4f8ee5
Contents?: true
Size: 973 Bytes
Versions: 3
Compression:
Stored size: 973 Bytes
Contents
#!/usr/bin/env ruby require 'rack' require 'optparse' require 'web-facter' options = {:daemonize => true, :port => 9294, :config => false} optparse = OptionParser.new do |opts| opts.banner = 'Usage: web-facter [options] ...' opts.separator '' opts.separator 'Configuration options:' opts.on( '--no-daemonize', "Don't daemonize the web server process") do |_| options[:daemonize] = false end opts.on( '-p', '--port PORT', 'The port to run web-facter on') do |port| options[:port] = port end opts.on( '-c', '--config FILE', 'The file to load with configuration options') do |file| options[:config] = file end opts.on_tail('-h', '--help', 'Display this screen') do puts opts exit end end begin optparse.parse! WebFacter::App.run!(options) rescue OptionParser::InvalidArgument, OptionParser::InvalidOption, OptionParser::MissingArgument puts $!.to_s puts optparse exit rescue Errno::EACCES puts $!.to_s exit end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
web-facter-0.1.2 | bin/web-facter |
web-facter-0.1.1 | bin/web-facter |
web-facter-0.1.0 | bin/web-facter |