If no args are given, then list possible importers.

This commit is contained in:
Parker Moore 2013-11-09 15:45:41 -05:00
parent 35ef90ac66
commit 4786cfcb5e
1 changed files with 7 additions and 1 deletions

View File

@ -118,10 +118,11 @@ Mercenary.program(:jekyll) do |p|
p.command(:import) do |c|
c.syntax 'jekyll import <platform> [options]'
c.description 'Import your old blog to Jekyll'
importers = []
begin
require 'jekyll-import'
JekyllImport.add_importer_commands(c)
importers = JekyllImport.add_importer_commands(c)
rescue LoadError
end
@ -131,6 +132,11 @@ Mercenary.program(:jekyll) do |p|
msg += "* Please see the documentation at http://jekyllrb.com/docs/migrations/ for instructions.\n"
abort msg
end
if args.empty?
Jekyll.logger.warn "You must specify an importer."
Jekyll.logger.info "Valid options are:"
importers.each { |i| Jekyll.logger.info "*", "#{i}" }
end
end
end
end