Sha256: 6fc5b49c96042634dce416037b15bcb432047ed7231517737b5aa5b0e1e31305
Contents?: true
Size: 1.68 KB
Versions: 34
Compression:
Stored size: 1.68 KB
Contents
#!/usr/bin/env ruby # This software code is made available "AS IS" without warranties of any # kind. You may copy, display, modify and redistribute the software # code either by itself or as incorporated into your code; provided that # you do not remove any proprietary notices. Your use of this software # code is at your own risk and you waive any claim against the author # with respect to your use of this software code. # (c) 2007 Static-CMS require 'optparse' require 'fileutils' require 'Scms' require "scms/version" require 'scms/scms-httpserver.rb' options = {} optparse = OptionParser.new do|opts| # Set a banner, displayed at the top of the help screen. opts.banner = "Usage: scms-server [options]" options[:website] = Dir::pwd opts.on( '-s', '--source DIR', 'Document Root of http server [default = current working dir]' ) do|d| options[:website] = d end options[:port] = 8008 opts.on( '-p', '--port PORT', 'port for http server [default = 8008]' ) do|p| options[:port] = p end options[:host] = Socket.gethostname opts.on( '-h', '--host HOST', 'http host for http server [default = localhost]' ) do|h| options[:host] = h end options[:version] = false opts.on( '-v', '--version', 'Output scms version' ) do puts "Version: #{Scms::VERSION}" exit end # This displays the help screen, all programs are assumed to have this option. opts.on( '-h', '--help', 'Display this help screen' ) do puts opts exit end end optparse.parse! #puts "Working dir: #{Dir::pwd}" #puts "Doc root: #{options[:website]}" ScmsServer.start(options[:website], options[:port], options[:host]) exit
Version data entries
34 entries across 34 versions & 1 rubygems