Sha256: bc1ca2559be0bc98be17b91e7c7bf9c141084f41338c6cf15ab3348f41b30c1b

Contents?: true

Size: 1.17 KB

Versions: 1

Compression:

Stored size: 1.17 KB

Contents

# -*- encoding : utf-8 -*-
require "git_stats"
require "thor"

class GitStats::CLI < Thor
  option :path, :aliases => :p, :default => '.', :desc => 'Path to repository from which statistics should be generated.'
  option :out_path, :aliases => :o, :default => './git_stats', :desc => 'Output path where statistics should be written.'
  option :language, :aliases => :l, :default => 'en', :desc => 'Language of written statistics.'
  option :from, :aliases => :f, :desc => 'Commit from where statistics should start.'
  option :to, :aliases => :t, :default => 'HEAD', :desc => 'Commit where statistics should stop.'
  option :silent, :aliases => :s, :type => :boolean, :desc => 'Silent mode. Don\'t output anything.'
  option :tree, :aliases => :d, :default => '.', :desc => 'Tree where statistics should be generated.'
  option :comment, :aliases => :c, :default => '//', :desc => 'The string which is used for comments.'
  
  desc 'generate', 'Generates the statistics of a repository'
  def generate
    I18n.locale = options[:language]
    GitStats::Generator.new(options) { |g|
      g.add_command_observer { |command, result| puts "#{command}" } unless options[:silent]
    }.render_all
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
git_stats-1.0.12 lib/git_stats/cli.rb