From 351877d6fd85fa76698f09e0bfff794c227c19b3 Mon Sep 17 00:00:00 2001 From: Tom Preston-Werner Date: Sat, 22 Nov 2008 00:55:29 -0800 Subject: [PATCH] better cli calling methods --- bin/jekyll | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/bin/jekyll b/bin/jekyll index 9d9a05dc..986c1715 100755 --- a/bin/jekyll +++ b/bin/jekyll @@ -4,8 +4,23 @@ $:.unshift File.join(File.dirname(__FILE__), *%w[.. lib]) require 'jekyll' -if ARGV[0] && ARGV[1] - Jekyll.process(ARGV[0], ARGV[1]) -else - puts "USAGE: jekyll /path/to/raw/site /path/to/generated/site" -end \ No newline at end of file +case ARGV.size + when 0 + dest = File.join('.', '_site') + FileUtils.mkdir_p(dest) + Jekyll.process('.', dest) + when 1 + Jekyll.process('.', ARGV[0]) + when 2 + 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