Sha256: 2a93e37604e0d9a69ec147e3756a7f7e785ecc5b803a218e00f9eaba035ace2c

Contents?: true

Size: 1.5 KB

Versions: 5

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 = 'Fetches and writes your token to the keychain 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

5 entries across 5 versions & 1 rubygems

Version Path
ios_polyglot_cli-2.2.2 exe/polyglot
ios_polyglot_cli-2.2.1 exe/polyglot
ios_polyglot_cli-2.2.0 exe/polyglot
ios_polyglot_cli-2.1.1 exe/polyglot
ios_polyglot_cli-2.1.0 exe/polyglot