Sha256: dfa764b21d21543da7b01ee3ac2a5aedf12698d2f76963acd0d94eb70300f4c1

Contents?: true

Size: 903 Bytes

Versions: 2

Compression:

Stored size: 903 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 :destination, :aliases => "-d", :required => true, :desc => "generating file destination"
    option :name, :aliases => "-n", :default => "Multilingual", :desc => "Localization struct name"
    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.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.1 lib/xcmultilingual/cli.rb
xcmultilingual-0.1.0 lib/xcmultilingual/cli.rb