Sha256: 33e2a1690d0c536ef5fa2a60d79551d7a666d2bcc5ec0ec3da6df42f349a8bc7

Contents?: true

Size: 970 Bytes

Versions: 2

Compression:

Stored size: 970 Bytes

Contents

require 'xcmultilingual'
require 'thor'
require 'set'

module Xcmultilingual
  class CLI < Thor
    class_option :verbose, :type => :boolean

    desc "update DESTINATION", "update xcmultilingual swift file"
    option :name, :aliases => "-n", :default => "Multilingual", :desc => "Localization struct name"
    option :template_path, :aliases => "-t", :desc => "User generated template file path"
    def update(destination)
      parser = Parser.new(destination)
      parser.verbose = options[:verbose] || false
      bundle_data = parser.parse

      writer = Writer.new(destination, bundle_data)
      writer.name = options[:name]
      writer.template_path = options[:template_path] if options[:template_path]
      writer.verbose = options[:verbose] || false
      writer.write

      puts "+ DONE" if options[:verbose]
      puts "" if options[:verbose]
      puts "  See #{destination}" if options[:verbose]
      puts "" if options[:verbose]
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
xcmultilingual-0.1.3 lib/xcmultilingual/cli.rb
xcmultilingual-0.1.2 lib/xcmultilingual/cli.rb