#!/usr/bin/env ruby # this file was generated by the 'commander' CLI, which is installed via 'gem install commander', # and it's used to simplify the process of building a CLI with Ruby. # if we were to create a CLI without commander, we would need to manually parse CLI arguments, # which is OFC fine, but this tool simplifies it require 'rubygems' require 'commander/import' require 'ios_analytics_cli' program :name, 'analytics' program :version, Analytics::VERSION program :description, Analytics.description command :init do |c| c.syntax = 'analytics init' c.summary = 'Creates the configuration for the analytics CLI.' c.description = 'Use this command to create an \'analytics.yml\' file, which will hold informations about your project, needed for the generation of the analytics files.' c.action do Analytics::ErrorHandler.rescuable do Analytics::Command::Init.new.perform end end end command :generate do |c| c.syntax = 'analytics generate' c.summary = 'Generates analytics files from the local JSON resource file.' c.description = 'This command uses settings stored in \'analytics.yml\' file, which defines a path for the resource JSON file, programming language & destination path for newly generated files & generated analytics files out of them.' c.action do Analytics::Command::Generate.new.perform end end