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|
|
p.command(:import) do |c|
|
||||||
c.syntax 'jekyll import <platform> [options]'
|
c.syntax 'jekyll import <platform> [options]'
|
||||||
c.description 'Import your old blog to Jekyll'
|
c.description 'Import your old blog to Jekyll'
|
||||||
|
importers = []
|
||||||
|
|
||||||
begin
|
begin
|
||||||
require 'jekyll-import'
|
require 'jekyll-import'
|
||||||
JekyllImport.add_importer_commands(c)
|
importers = JekyllImport.add_importer_commands(c)
|
||||||
rescue LoadError
|
rescue LoadError
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -131,6 +132,11 @@ Mercenary.program(:jekyll) do |p|
|
||||||
msg += "* Please see the documentation at http://jekyllrb.com/docs/migrations/ for instructions.\n"
|
msg += "* Please see the documentation at http://jekyllrb.com/docs/migrations/ for instructions.\n"
|
||||||
abort msg
|
abort msg
|
||||||
end
|
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
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue