From 3f8b9a08faee062e24350a964526a9d7d2882c79 Mon Sep 17 00:00:00 2001 From: Tom Preston-Werner Date: Sat, 6 Dec 2008 14:53:03 -0800 Subject: [PATCH] add --auto option --- bin/jekyll | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/bin/jekyll b/bin/jekyll index a8471a22067..e70e1058f0d 100755 --- a/bin/jekyll +++ b/bin/jekyll @@ -2,8 +2,28 @@ $:.unshift File.join(File.dirname(__FILE__), *%w[.. lib]) +require 'optparse' require 'jekyll' +opts = OptionParser.new do |opts| + opts.banner = <<-EOF +Jekyll is a blog-aware, static site generator. + +Basic Command Line Usage: + jekyll # . -> ./_site + jekyll # . -> + jekyll # -> + + Options: +EOF + + opts.on("--auto", "Auto-regenerate") do + options[:auto] = true + end +end + +opts.parse! + case ARGV.size when 0 dest = File.join('.', '_site') @@ -16,12 +36,4 @@ case ARGV.size Jekyll.process(ARGV[0], ARGV[1]) else puts DATA.read -end - -__END__ -Jekyll is a blog-aware, static site generator. - -Basic Command Line Usage: - jekyll # . -> ./_site - jekyll # . -> - jekyll # -> \ No newline at end of file +end \ No newline at end of file