From 47a894cebfe79bf01a1de54b0067357ac97a0073 Mon Sep 17 00:00:00 2001 From: Tom Preston-Werner Date: Sun, 21 Dec 2008 21:48:04 -0800 Subject: [PATCH] allow optional port argument to --server --- History.txt | 2 +- bin/jekyll | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/History.txt b/History.txt index f0f06e13..37bc9aae 100644 --- a/History.txt +++ b/History.txt @@ -1,6 +1,6 @@ == * Major Enhancements - * Added --server option to start a simple WEBrick server on destination directory [github.com/johnreilly] + * Added --server option to start a simple WEBrick server on destination directory [github.com/johnreilly and github.com/mchung] * Minor Enhancements * Added post categories based on directories containing _posts [github.com/mreid] * Added new date filter that shows the full month name [github.com/mreid] diff --git a/bin/jekyll b/bin/jekyll index 307e4936..fb4abdc8 100755 --- a/bin/jekyll +++ b/bin/jekyll @@ -25,8 +25,9 @@ opts = OptionParser.new do |opts| options[:auto] = true end - opts.on("--server", "Run a WEBrick server on destination directory") do + opts.on("--server [PORT]", "Start web server (default port 4000)") do |port| options[:server] = true + options[:server_port] = port || 4000 end opts.on("--lsi", "Use LSI for better related posts") do @@ -87,7 +88,7 @@ if options[:server] include WEBrick s = HTTPServer.new( - :Port => 4000, + :Port => options[:server_port], :DocumentRoot => destination ) t = Thread.new {