Skip to content

Commit

Permalink
add --auto option
Browse files Browse the repository at this point in the history
  • Loading branch information
mojombo committed Dec 7, 2008
1 parent 5b0ce6d commit 3f8b9a0
Showing 1 changed file with 21 additions and 9 deletions.
30 changes: 21 additions & 9 deletions bin/jekyll
Expand Up @@ -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 <path to write generated site> # . -> <path>
jekyll <path to source> <path to write generated site> # <path> -> <path>
Options:
EOF

opts.on("--auto", "Auto-regenerate") do
options[:auto] = true
end
end

opts.parse!

case ARGV.size
when 0
dest = File.join('.', '_site')
Expand All @@ -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 <path to write generated site> # . -> <path>
jekyll <path to source> <path to write generated site> # <path> -> <path>
end

0 comments on commit 3f8b9a0

Please sign in to comment.