added command-line option --paginate_path

This commit is contained in:
Dane Harrigan 2011-06-05 15:11:35 -04:00
parent 2b8017dfdc
commit 58d8fef7ec
1 changed files with 13 additions and 3 deletions

View File

@ -113,6 +113,16 @@ opts = OptionParser.new do |opts|
end
end
opts.on("--paginate_path [PAGINATED_URL_FORMAT]", "Leave blank for /page<num>") do |paginate_path|
begin
options['paginate_path'] = paginate_path
raise ArgumentError if options['paginate_path'].nil?
rescue
puts 'You must specify a pagination url format'
exit 0
end
end
opts.on("--limit_posts [MAX_POSTS]", "Limit the number of posts to publish") do |limit_posts|
begin
options['limit_posts'] = limit_posts.to_i