If no args are given, then list possible importers.
This commit is contained in:
parent
35ef90ac66
commit
4786cfcb5e
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue