Sha256: 25998d228cb5c568dca64fe74aeb35faf90db211ba2d1fff44ff7a7eca199ce5

Contents?: true

Size: 1.83 KB

Versions: 4

Compression:

Stored size: 1.83 KB

Contents

#!/usr/bin/env ruby

require 'escort'
require_relative '../lib/cli'

I18n.enforce_available_locales = false

fail ArgumentError, 'Set path for configuration file and define action. More details you can find in README.' if ARGF.argv.empty?
fail ArgumentError, "Missing '--config-file' argument. The correct is form: 'wordpress-exporter --config-file PATH_TO_CONFIGURATION_FILE --action'. View README." unless ARGV.include?('--config-file')

Escort::App.create do |app|
  app.summary 'Executable file of Wordpress exporter'

  app.options do |opts|
    opts.opt :file, '--config-file', short: '-f', long: '--config-file', type: :string

    app.command '--extract-to-json' do |command|
      command.summary 'Extract data from Wordpress XML dump file and save as JSON files'
      command.options do |opts|
        opts.opt :omit_content_model, 'omit', short: '-o', long: '--omit-content-model', type: :boolean, default: false
      end
      command.action do |options, arguments|
        Command::CLI.new(options, arguments).execute
      end
    end
    app.command '--create-contentful-model-from-json' do |command|
      command.summary 'Create content types files, based on contentful structure json file. View README'
      command.action do |options, arguments|
        Command::CLI.new(options, arguments).execute
      end
    end
    app.command '--convert-content-model-to-json' do |command|
      command.summary 'Transform content_model file into contentful_structure import form. View README'
      command.action do |options, arguments|
        Command::CLI.new(options, arguments).execute
      end
    end

    app.command '--convert-markup' do |command|
      command.summary 'Convert markup to markdown in post content. View README'
      command.action do |options, arguments|
        Command::CLI.new(options, arguments).execute
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
wordpress-exporter-0.2.0 bin/wordpress-exporter
wordpress-exporter-0.1.0 bin/wordpress-exporter
wordpress-exporter-0.0.2 bin/wordpress-exporter
wordpress-exporter-0.0.1 bin/wordpress-exporter