def run
      if @options[:mode] == :diffs
        DiffAnalyzer.new(@options[:path], @options).run!
        return
      end

      if @options[:days].present?
        @args = "-d #{@options[:days]}"
      else
        @args = "-A \"#{@options[:from]} 00:00\" -B \"#{@options[:to]} 23:59\""
      end
      puts "Entering #{@options[:path]} ..."

      Dir.chdir(@options[:path]) do
        cmd = "git standup -s #{@args}"
        puts "Running #{cmd}"
        puts
        out = `#{cmd}`
        # out.split(/\/home\/.*$/)
        total_count = `#{cmd} | grep -v #{@options[:path]}* -c`
        projects = `#{cmd} | grep #{@options[:path]}* --color=never`
        projects = projects.split("\n")
        project_hash = {}
        commits_per_project = out.split(/\/home\/.*$/)
        commits_per_project.delete_at(0)
        commits_per_project.each_with_index do |commits, index|
          count = commits.split("\\n\n").count
          project_hash[projects[index]] = {
            count: count,
            percentage: (count / total_count.to_f * 100)
          }
        end
        puts "Total projects: #{projects.size}, total commits: #{total_count}"
        project_hash.each do |project, hash|
          project = +project
          project.slice!("#{@options[:path]}/")
          puts "#{project}: #{hash[:count]} / #{hash[:percentage].floor(2)}%"
        end
      end
    end
def run
      if @options[:mode] == :diffs
        DiffAnalyzer.new(@options[:path], @options).run!
        return
      end

      if @options[:days].present?
        @args = "-d #{@options[:days]}"
      else
        @args = "-A \"#{@options[:from]} 00:00\" -B \"#{@options[:to]} 23:59\""
      end
      puts "Entering #{@options[:path]} ..."

      Dir.chdir(@options[:path]) do
        cmd = "git standup -s #{@args}"
        puts "Running #{cmd}"
        puts
        out = `#{cmd}`
        # out.split(/\/home\/.*$/)
        total_count = `#{cmd} | grep -v #{@options[:path]}* -c`
        projects = `#{cmd} | grep #{@options[:path]}* --color=never`
        projects = projects.split("\n")
        project_hash = {}
        commits_per_project = out.split(/\/home\/.*$/)
        commits_per_project.delete_at(0)
        commits_per_project.each_with_index do |commits, index|
          count = commits.split("\\n\n").count
          project_hash[projects[index]] = {
            count: count,
            percentage: (count / total_count.to_f * 100)
          }
        end
        puts "Total projects: #{projects.size}, total commits: #{total_count}"
        project_hash.each do |project, hash|
          project = +project
          project.slice!("#{@options[:path]}/")
          puts "#{project}: #{hash[:count]} / #{hash[:percentage].floor(2)}%"
        end
      end
    end
TODO:
 Use this example:
   $ git diff HEAD 'HEAD@{3 weeks ago}' --shortstat -b -w
 to go through each directory and analyze output "202 files changed, 401 insertions(+), 2959 deletions(-)"
 Preferably use threads to increase performance
 add option for shallow loop or deep with limit, default could be 10