Let jekyll-import specify subcommands and their options for each importer.

@mojombo, this look better?
This commit is contained in:
Parker Moore 2013-11-08 14:50:18 -05:00
parent b61534d260
commit b923df0c01
1 changed files with 2 additions and 12 deletions

View File

@ -119,28 +119,18 @@ Mercenary.program(:jekyll) do |p|
c.syntax 'jekyll import <platform> [options]'
c.description 'Import your old blog to Jekyll'
c.option 'source', '--source STRING', 'Source file or URL to migrate from'
c.option 'file', '--file STRING', 'File to migrate from'
c.option 'dbname', '--dbname STRING', 'Database name to migrate from'
c.option 'user', '--user STRING', 'Username to use when migrating'
c.option 'pass', '--pass STRING', 'Password to use when migrating'
c.option 'host', '--host STRING', 'Host address to use when migrating'
c.option 'prefix', '--prefix STRING', 'Database table prefix to use when migrating'
begin
require 'jekyll-import'
rescue LoadError
JekyllImport.add_importer_commands(c)
end
c.action do |args, options|
begin
require 'jekyll-import'
rescue LoadError
if defined?(JekyllImport)
msg = "You must install the 'jekyll-import' gem before continuing.\n"
msg += "* Please see the documentation at http://jekyllrb.com/docs/migrations/ for instructions.\n"
abort msg
end
Jekyll::Commands::Import.process(args.first, options)
end
end
end