bin/vrowser in vrowser-0.0.4 vs bin/vrowser in vrowser-0.0.5
- old
+ new
@@ -2,10 +2,11 @@
# encoding: utf-8
# Author: kimoto
require 'vrowser'
require 'optparse'
require 'vrowser/http_daemon'
+require 'fileutils'
options = {}
parser = OptionParser.new{ |opts|
opts.banner = "Usage: #{File.basename($0)}"
opts.on("-f", "--config-file=PATH", "specify config file"){ |v|
@@ -16,9 +17,15 @@
opts.on("-p", "--port=PORT", "port"){ |v| options[:port] = v }
opts.on("-r", "--document-root=PATH", "root"){ |v| options[:document_root] = v }
}
parser.parse!
+
+if ARGV.first == "sample"
+ p sample_config = File.expand_path(File.join(File.dirname(__FILE__), "../examples/config.yml"))
+ FileUtils.cp(sample_config, "./config.yml", :verbose => true)
+ exit(0)
+end
if options[:config_path].nil?
parser.help.display
exit(1)
end