allow optional port argument to --server
This commit is contained in:
parent
fd88a56c55
commit
47a894cebf
|
@ -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]
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue