#!/usr/bin/env ruby require 'rubygems' require 'commander/import' require_relative '../lib/ClassAnalyzer' program :version, '0.0.2' program :description, 'Swift Code Coverage Static Analyzer' command :gen do |c| c.syntax = 'dftcc gen directory/with/Swift/files [--output ]' c.summary = 'Generates analysis report of code coverage' c.description = 'Generates analysis report of code coverage.' c.option '--output PATH', 'Optional output directory' c.action do |args, options| if args.count < 2 say_error "You must provide the directory of Swift files to analyze:" say_error "\t dftsg gen directory/with/Swift/files" elsif args.count > 2 say_error "If you want to select an output directory, use the --output command" say_error "\t dftsg gen directory/with/Swift/files --output my/output/directory" elsif args.count == 2 input = args.first inputTest = args[1] output = options.output analyzer = ClassAnalyzer.new(input, inputTest, output) analyzer.analyze end end end