Sha256: 3cc522a3d32e4512657353584ed79cf9e38430204413a2900bde6fbffdd6876a

Contents?: true

Size: 1.5 KB

Versions: 2

Compression:

Stored size: 1.5 KB

Contents

#!/usr/bin/env ruby

require 'rubygems'
require 'commander'
require 'commander/import'
require 'ios_polyglot_cli'

program :name, 'polyglot'
program :version, PolyglotIos::VERSION
program :description, 'An iOS client for managing polyglot\'s translations.'

command :login do |c|
  c.syntax = 'polyglot login'
  c.description = 'Login to Polyglot and fetches the token using the email and password you provide.'
  c.action do
    PolyglotIos::ErrorHandler.rescuable do
      PolyglotIos::Command::Login.init
    end
  end
end

command :init do |c|
  c.syntax = 'polyglot init [options]'
  c.description = 'Sets up a polyglot.yml config for selected project.'
  c.option '--query STRING', String, 'Only show projects which name matches query string.'
  c.action do |_args, options|
    PolyglotIos::ErrorHandler.rescuable do
      PolyglotIos::Command::Setup.init(options)
    end
  end
end

command :projects do |c|
  c.syntax = 'polyglot projects [options]'
  c.description = 'Lists all available polyglot projects with their IDs.'
  c.option '--query STRING', String, 'Only show projects which name matches query string.'
  c.action do |_args, options|
    PolyglotIos::ErrorHandler.rescuable do
      PolyglotIos::Command::Projects.init(options)
    end
  end
end

command :pull do |c|
  c.syntax = 'polyglot pull'
  c.description = 'Pulls all translations from Polyglot and generates necessary files'
  c.action do |_args, options|
    PolyglotIos::ErrorHandler.rescuable do
      PolyglotIos::Command::Pull.init
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ios_polyglot_cli-2.4.0 exe/polyglot
ios_polyglot_cli-2.3.0 exe/polyglot